From 281460fb0306c21157d9f91837a90c542338735a Mon Sep 17 00:00:00 2001 From: lezi-fun <177434121+lezi-fun@users.noreply.github.com> Date: Sun, 9 Aug 2026 17:00:10 +0800 Subject: [PATCH 01/10] feat: migrate to Next.js 14 (App Router + Route Handlers) - Replace Express server with Next.js Route Handlers (16 API routes) - Rewrite index.html SPA as React components (feed, post, admin, modals) - Move style.css to app/globals.css with dark/light themes intact - Add lib/db.js, lib/auth.js (JWT), lib/api.js (client API wrapper) - Server binds 0.0.0.0 by default; host/port configurable via config.js - Uploads served via /api/uploads route (rewrite keeps /uploads/ URLs) - Multi-stage dockerfile using standalone output --- .gitignore | 2 + README.md | 57 +- app/api/auth/login/route.js | 40 + app/api/auth/me/route.js | 22 + app/api/auth/register/route.js | 38 + app/api/event-logs/route.js | 42 + app/api/links/[id]/route.js | 18 + app/api/links/route.js | 37 + app/api/posts/[id]/replies/route.js | 42 + app/api/posts/[id]/route.js | 50 + app/api/posts/route.js | 45 + app/api/replies/[id]/route.js | 29 + app/api/reports/[id]/route.js | 33 + app/api/reports/route.js | 55 + app/api/settings/route.js | 35 + app/api/stats/route.js | 19 + app/api/upload/route.js | 40 + app/api/users/[id]/role/route.js | 27 + app/api/users/[id]/route.js | 46 + app/api/users/route.js | 17 + style.css => app/globals.css | 6 +- app/layout.js | 15 + app/page.js | 59 + bun.lock | 246 ++++ components/AdminPage.js | 47 + components/AppProvider.js | 161 +++ components/Feed.js | 105 ++ components/Modals.js | 142 +++ components/Navbar.js | 85 ++ components/NewPost.js | 118 ++ components/PostDetail.js | 87 ++ components/ReplyList.js | 116 ++ components/SettingsPage.js | 50 + components/Sidebar.js | 39 + components/admin/AdminForumSettings.js | 48 + components/admin/AdminLinks.js | 66 ++ components/admin/AdminLogs.js | 41 + components/admin/AdminReports.js | 62 + components/admin/AdminUsers.js | 93 ++ config.js | 5 + docker-compose.yml | 4 +- dockerfile | 30 +- index.html | 1488 ----------------------- jsconfig.json | 8 + lib/api.js | 127 ++ lib/auth.js | 42 + lib/db.js | 12 + next.config.js | 12 + package-lock.json | 1513 +++++------------------- package.json | 24 +- scripts/start.js | 21 + server.js | 639 ---------- 52 files changed, 2833 insertions(+), 3372 deletions(-) create mode 100644 app/api/auth/login/route.js create mode 100644 app/api/auth/me/route.js create mode 100644 app/api/auth/register/route.js create mode 100644 app/api/event-logs/route.js create mode 100644 app/api/links/[id]/route.js create mode 100644 app/api/links/route.js create mode 100644 app/api/posts/[id]/replies/route.js create mode 100644 app/api/posts/[id]/route.js create mode 100644 app/api/posts/route.js create mode 100644 app/api/replies/[id]/route.js create mode 100644 app/api/reports/[id]/route.js create mode 100644 app/api/reports/route.js create mode 100644 app/api/settings/route.js create mode 100644 app/api/stats/route.js create mode 100644 app/api/upload/route.js create mode 100644 app/api/users/[id]/role/route.js create mode 100644 app/api/users/[id]/route.js create mode 100644 app/api/users/route.js rename style.css => app/globals.css (99%) create mode 100644 app/layout.js create mode 100644 app/page.js create mode 100644 bun.lock create mode 100644 components/AdminPage.js create mode 100644 components/AppProvider.js create mode 100644 components/Feed.js create mode 100644 components/Modals.js create mode 100644 components/Navbar.js create mode 100644 components/NewPost.js create mode 100644 components/PostDetail.js create mode 100644 components/ReplyList.js create mode 100644 components/SettingsPage.js create mode 100644 components/Sidebar.js create mode 100644 components/admin/AdminForumSettings.js create mode 100644 components/admin/AdminLinks.js create mode 100644 components/admin/AdminLogs.js create mode 100644 components/admin/AdminReports.js create mode 100644 components/admin/AdminUsers.js delete mode 100644 index.html create mode 100644 jsconfig.json create mode 100644 lib/api.js create mode 100644 lib/auth.js create mode 100644 lib/db.js create mode 100644 next.config.js create mode 100644 scripts/start.js delete mode 100644 server.js diff --git a/.gitignore b/.gitignore index af05b1e..097a6e6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ node_modules/ +.next/ +out/ uploads/ *.log .DS_Store diff --git a/README.md b/README.md index bf9cb8c..a6d09af 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ ## ✨ 特性 - 🎨 精致简约的界面设计,支持亮色/暗色模式 -- ⚡️ 轻量快速,无需复杂配置 +- ⚡️ 基于 Next.js 14 (App Router) + React 18,前后端一体化 - 🔐 自带用户认证(JWT) - 📝 发帖、回复、举报、管理后台 - 🐳 Docker 一键部署 @@ -21,12 +21,7 @@ cd forumlify docker-compose up -d ``` -应用默认运行在 `http://localhost:3003`。 - ---- -以下内容添加自NodeLoc @Lezi-fun的PR - ---- +应用默认运行在 `http://localhost:3000`(监听 `0.0.0.0`,局域网可访问)。 ### 从源码构建 @@ -34,7 +29,7 @@ docker-compose up -d #### 环境要求 -- Node.js 18+ +- Node.js 18.17+(Next.js 14 要求) - PostgreSQL 13+(`schema.sql` 使用了内置的 `gen_random_uuid()`) #### 步骤 @@ -62,7 +57,6 @@ psql -U forumlify -d forumlify -f schema.sql | 变量 | 默认值 | 说明 | |------|--------|------| | `DATABASE_URL` | `postgresql://forumlify:123456@localhost:5432/forumlify` | PostgreSQL 连接串 | -| `PORT` | `3000` | HTTP 监听端口 | | `JWT_SECRET` | `forumlify-secret-key-change-me-in-production` | JWT 签名密钥,**生产环境务必修改** | ```bash @@ -71,23 +65,25 @@ export DATABASE_URL=postgresql://forumlify:123456@localhost:5432/forumlify export JWT_SECRET=your-own-secret-key ``` -4. **启动** +4. **构建并启动** ```bash +npm run build npm start ``` 应用运行在 `http://localhost:3000`,API 在 `http://localhost:3000/api`。 -#### 前端配置 +开发模式(热更新):`npm run dev`。 -前端页面为 `index.html`,相关行为可在 `config.js` 中调整: +#### 服务端配置 + +监听端口与地址可在 `config.js` 中调整(服务端读取,浏览器端忽略): | 配置项 | 默认值 | 说明 | |--------|--------|------| -| `FORUM_NAME` | `Forumlify` | 论坛名称(左上角显示) | -| `ENABLE_CAPTCHA` | `true` | 发帖/注册的人机验证(10 以内加减法) | -| `SERVER_PORT` | `null` | 可选:服务端监听端口(仅服务端读取,浏览器端忽略)。优先级:环境变量 `PORT` > `SERVER_PORT` > 默认 `3000`。设为 `null` 时使用环境变量或默认值 | +| `SERVER_PORT` | `null` | 可选:监听端口。优先级:环境变量 `PORT` > `SERVER_PORT` > 默认 `3000` | +| `SERVER_HOST` | `null` | 可选:监听地址。优先级:环境变量 `HOST` > `SERVER_HOST` > 默认 `0.0.0.0`(所有网卡)。设为 `127.0.0.1` 仅本机访问 | #### 上传目录 @@ -96,3 +92,34 @@ npm start ```bash mkdir -p uploads && chmod 755 uploads ``` + +## 🏗️ 项目结构 + +``` +app/ + page.js # 主页(SPA 视图调度) + layout.js # 全局布局 + globals.css # 全局样式(含亮/暗主题) + api/ # Route Handlers(API 后端) + auth/ posts/ replies/ users/ reports/ links/ + stats/ event-logs/ settings/ upload/ uploads/ +components/ + AppProvider.js # 全局状态(用户/主题/路由) + Navbar.js Feed.js PostDetail.js ReplyList.js + NewPost.js AdminPage.js SettingsPage.js Modals.js +lib/ + db.js # PostgreSQL 连接池 + auth.js # JWT 认证工具 + api.js # 前端 API 封装 +scripts/ + start.js # 启动入口(读取 config.js 监听配置) +schema.sql # 数据库表结构 +config.js # 服务端配置(端口/地址) +``` + +## 📚 技术栈 + +- Next.js 14 (App Router) + React 18 +- Express 风格 Route Handlers (Node.js Runtime) +- PostgreSQL + pg +- JWT 认证 + bcrypt 密码哈希 diff --git a/app/api/auth/login/route.js b/app/api/auth/login/route.js new file mode 100644 index 0000000..18721f6 --- /dev/null +++ b/app/api/auth/login/route.js @@ -0,0 +1,40 @@ +// POST /api/auth/login +import bcrypt from 'bcrypt'; +import jwt from 'jsonwebtoken'; +import pool from '@/lib/db'; +import { JWT_SECRET } from '@/lib/auth'; + +export async function POST(req) { + const { email, password } = await req.json(); + if (!email || !password) { + return Response.json({ error: '请填写邮箱和密码' }, { status: 400 }); + } + try { + const r = await pool.query('SELECT * FROM users WHERE email = $1', [email]); + const user = r.rows[0]; + if (!user) { + return Response.json({ error: '邮箱或密码错误' }, { status: 401 }); + } + const valid = await bcrypt.compare(password, user.password_hash); + if (!valid) { + return Response.json({ error: '邮箱或密码错误' }, { status: 401 }); + } + const token = jwt.sign( + { id: user.id, email: user.email, role: user.role }, + JWT_SECRET, + { expiresIn: '7d' } + ); + return Response.json({ + token, + user: { + id: user.id, + username: user.username, + avatar_url: user.avatar_url, + bio: user.bio, + role: user.role, + }, + }); + } catch { + return Response.json({ error: '登录失败,请稍后重试' }, { status: 500 }); + } +} diff --git a/app/api/auth/me/route.js b/app/api/auth/me/route.js new file mode 100644 index 0000000..44c6a72 --- /dev/null +++ b/app/api/auth/me/route.js @@ -0,0 +1,22 @@ +// GET /api/auth/me +import pool from '@/lib/db'; +import { getUser } from '@/lib/auth'; + +export async function GET(req) { + const user = getUser(req); + if (!user) { + return Response.json({ error: '请先登录' }, { status: 401 }); + } + try { + const r = await pool.query( + 'SELECT id, username, avatar_url, bio, role, created_at FROM users WHERE id = $1', + [user.id] + ); + if (!r.rows[0]) { + return Response.json({ error: '用户不存在' }, { status: 404 }); + } + return Response.json(r.rows[0]); + } catch { + return Response.json({ error: '服务器错误' }, { status: 500 }); + } +} diff --git a/app/api/auth/register/route.js b/app/api/auth/register/route.js new file mode 100644 index 0000000..f7f8e5c --- /dev/null +++ b/app/api/auth/register/route.js @@ -0,0 +1,38 @@ +// POST /api/auth/register +import bcrypt from 'bcrypt'; +import pool from '@/lib/db'; + +export async function POST(req) { + const { email, password, username } = await req.json(); + if (!email || !password || !username) { + return Response.json({ error: '请填写完整信息' }, { status: 400 }); + } + if (password.length < 6) { + return Response.json({ error: '密码至少6位' }, { status: 400 }); + } + try { + const countResult = await pool.query('SELECT COUNT(*) FROM users'); + const isFirstUser = parseInt(countResult.rows[0].count) === 0; + + const hash = await bcrypt.hash(password, 10); + const avatar = 'https://ui-avatars.com/api/?name=' + encodeURIComponent(username) + '&background=6366f1&color=fff&size=64'; + const role = isFirstUser ? 'admin' : 'user'; + + const r = await pool.query( + `INSERT INTO users (email, password_hash, username, avatar_url, role) + VALUES ($1, $2, $3, $4, $5) + RETURNING id, username, avatar_url, role, created_at`, + [email, hash, username, avatar, role] + ); + + return Response.json({ + user: r.rows[0], + message: isFirstUser ? '🎉 你是第一个用户,已自动设为管理员!' : '注册成功', + }); + } catch (err) { + if (err.code === '23505') { + return Response.json({ error: '邮箱或用户名已被注册' }, { status: 400 }); + } + return Response.json({ error: '注册失败,请稍后重试' }, { status: 500 }); + } +} diff --git a/app/api/event-logs/route.js b/app/api/event-logs/route.js new file mode 100644 index 0000000..b9176a2 --- /dev/null +++ b/app/api/event-logs/route.js @@ -0,0 +1,42 @@ +// GET /api/event-logs, POST /api/event-logs +import pool from '@/lib/db'; +import { getUser, requireAdmin } from '@/lib/auth'; + +export async function GET(req) { + const user = getUser(req); + if (!user) { + return Response.json({ error: '请先登录' }, { status: 401 }); + } + const forbidden = await requireAdmin(user); + if (forbidden) return forbidden; + try { + const r = await pool.query( + `SELECT el.*, u.username + FROM event_logs el + LEFT JOIN users u ON el.user_id = u.id + ORDER BY el.created_at DESC + LIMIT 100` + ); + return Response.json(r.rows); + } catch { + return Response.json({ error: '服务器错误' }, { status: 500 }); + } +} + +export async function POST(req) { + const user = getUser(req); + if (!user) { + return Response.json({ error: '请先登录' }, { status: 401 }); + } + const { action } = await req.json(); + try { + await pool.query( + `INSERT INTO event_logs (user_id, action, ip) + VALUES ($1, $2, $3)`, + [user.id, action, req.headers.get('x-forwarded-for') || '0.0.0.0'] + ); + return Response.json({ success: true }); + } catch { + return Response.json({ success: true }); + } +} diff --git a/app/api/links/[id]/route.js b/app/api/links/[id]/route.js new file mode 100644 index 0000000..65766a4 --- /dev/null +++ b/app/api/links/[id]/route.js @@ -0,0 +1,18 @@ +// DELETE /api/links/[id] +import pool from '@/lib/db'; +import { getUser, requireAdmin } from '@/lib/auth'; + +export async function DELETE(req, { params }) { + const user = getUser(req); + if (!user) { + return Response.json({ error: '请先登录' }, { status: 401 }); + } + const forbidden = await requireAdmin(user); + if (forbidden) return forbidden; + try { + await pool.query('DELETE FROM friendly_links WHERE id = $1', [params.id]); + return Response.json({ success: true }); + } catch { + return Response.json({ error: '删除失败,请稍后重试' }, { status: 500 }); + } +} diff --git a/app/api/links/route.js b/app/api/links/route.js new file mode 100644 index 0000000..70d12de --- /dev/null +++ b/app/api/links/route.js @@ -0,0 +1,37 @@ +// GET /api/links, POST /api/links +import pool from '@/lib/db'; +import { getUser, requireAdmin } from '@/lib/auth'; + +export async function GET() { + try { + const r = await pool.query('SELECT * FROM friendly_links ORDER BY sort_order'); + return Response.json(r.rows); + } catch { + return Response.json({ error: '服务器错误' }, { status: 500 }); + } +} + +export async function POST(req) { + const user = getUser(req); + if (!user) { + return Response.json({ error: '请先登录' }, { status: 401 }); + } + const forbidden = await requireAdmin(user); + if (forbidden) return forbidden; + + const { title, url } = await req.json(); + if (!title || !url) { + return Response.json({ error: '请填写完整信息' }, { status: 400 }); + } + try { + const r = await pool.query( + `INSERT INTO friendly_links (title, url) + VALUES ($1, $2) + RETURNING *`, + [title, url] + ); + return Response.json(r.rows[0]); + } catch { + return Response.json({ error: '添加失败,请稍后重试' }, { status: 500 }); + } +} diff --git a/app/api/posts/[id]/replies/route.js b/app/api/posts/[id]/replies/route.js new file mode 100644 index 0000000..0534bde --- /dev/null +++ b/app/api/posts/[id]/replies/route.js @@ -0,0 +1,42 @@ +// GET /api/posts/[id]/replies, POST /api/posts/[id]/replies +import pool from '@/lib/db'; +import { getUser } from '@/lib/auth'; + +export async function GET(req, { params }) { + try { + const r = await pool.query( + `SELECT r.*, u.username, u.avatar_url + FROM replies r + JOIN users u ON r.user_id = u.id + WHERE r.post_id = $1 + ORDER BY r.created_at ASC`, + [params.id] + ); + return Response.json(r.rows); + } catch { + return Response.json({ error: '服务器错误' }, { status: 500 }); + } +} + +export async function POST(req, { params }) { + const user = getUser(req); + if (!user) { + return Response.json({ error: '请先登录' }, { status: 401 }); + } + const { content } = await req.json(); + if (!content || content.trim().length === 0) { + return Response.json({ error: '请填写回复内容' }, { status: 400 }); + } + try { + const r = await pool.query( + `INSERT INTO replies (post_id, user_id, content) + VALUES ($1, $2, $3) + RETURNING *`, + [params.id, user.id, content] + ); + await pool.query('UPDATE posts SET updated_at = NOW() WHERE id = $1', [params.id]); + return Response.json(r.rows[0]); + } catch { + return Response.json({ error: '回复失败,请稍后重试' }, { status: 500 }); + } +} diff --git a/app/api/posts/[id]/route.js b/app/api/posts/[id]/route.js new file mode 100644 index 0000000..46f14a8 --- /dev/null +++ b/app/api/posts/[id]/route.js @@ -0,0 +1,50 @@ +// GET /api/posts/[id], DELETE /api/posts/[id] +import pool from '@/lib/db'; +import { getUser } from '@/lib/auth'; + +const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i; + +function invalidId() { + return Response.json({ error: '帖子不存在' }, { status: 404 }); +} + +export async function GET(req, { params }) { + if (!UUID_RE.test(params.id)) return invalidId(); + try { + const r = await pool.query( + `SELECT p.*, u.username, u.avatar_url + FROM posts p + JOIN users u ON p.user_id = u.id + WHERE p.id = $1`, + [params.id] + ); + if (r.rows.length === 0) { + return invalidId(); + } + return Response.json(r.rows[0]); + } catch { + return Response.json({ error: '服务器错误' }, { status: 500 }); + } +} + +export async function DELETE(req, { params }) { + if (!UUID_RE.test(params.id)) return invalidId(); + const user = getUser(req); + if (!user) { + return Response.json({ error: '请先登录' }, { status: 401 }); + } + try { + const post = await pool.query('SELECT user_id FROM posts WHERE id = $1', [params.id]); + if (post.rows.length === 0) { + return invalidId(); + } + const u = await pool.query('SELECT role FROM users WHERE id = $1', [user.id]); + if (post.rows[0].user_id !== user.id && u.rows[0]?.role !== 'admin') { + return Response.json({ error: '无权限删除此帖子' }, { status: 403 }); + } + await pool.query('DELETE FROM posts WHERE id = $1', [params.id]); + return Response.json({ success: true }); + } catch { + return Response.json({ error: '删除失败,请稍后重试' }, { status: 500 }); + } +} diff --git a/app/api/posts/route.js b/app/api/posts/route.js new file mode 100644 index 0000000..dd80e59 --- /dev/null +++ b/app/api/posts/route.js @@ -0,0 +1,45 @@ +// GET /api/posts, POST /api/posts +import pool from '@/lib/db'; +import { getUser } from '@/lib/auth'; + +export async function GET(req) { + const url = new URL(req.url); + const sort = url.searchParams.get('sort') === 'hot' ? 'updated_at' : 'created_at'; + try { + const r = await pool.query(` + SELECT + p.*, + u.username, + u.avatar_url, + (SELECT COUNT(*) FROM replies WHERE post_id = p.id) as reply_count + FROM posts p + JOIN users u ON p.user_id = u.id + ORDER BY ${sort} DESC + `); + return Response.json(r.rows); + } catch { + return Response.json({ error: '服务器错误' }, { status: 500 }); + } +} + +export async function POST(req) { + const user = getUser(req); + if (!user) { + return Response.json({ error: '请先登录' }, { status: 401 }); + } + const { title, content, images } = await req.json(); + if (!content || content.trim().length === 0) { + return Response.json({ error: '请填写内容' }, { status: 400 }); + } + try { + const r = await pool.query( + `INSERT INTO posts (user_id, title, content, images) + VALUES ($1, $2, $3, $4) + RETURNING *`, + [user.id, title || '无标题', content, images || []] + ); + return Response.json(r.rows[0]); + } catch { + return Response.json({ error: '发布失败,请稍后重试' }, { status: 500 }); + } +} diff --git a/app/api/replies/[id]/route.js b/app/api/replies/[id]/route.js new file mode 100644 index 0000000..52580b5 --- /dev/null +++ b/app/api/replies/[id]/route.js @@ -0,0 +1,29 @@ +// DELETE /api/replies/[id] +import pool from '@/lib/db'; +import { getUser } from '@/lib/auth'; + +const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i; + +export async function DELETE(req, { params }) { + if (!UUID_RE.test(params.id)) { + return Response.json({ error: '回复不存在' }, { status: 404 }); + } + const user = getUser(req); + if (!user) { + return Response.json({ error: '请先登录' }, { status: 401 }); + } + try { + const reply = await pool.query('SELECT user_id FROM replies WHERE id = $1', [params.id]); + if (reply.rows.length === 0) { + return Response.json({ error: '回复不存在' }, { status: 404 }); + } + const u = await pool.query('SELECT role FROM users WHERE id = $1', [user.id]); + if (reply.rows[0].user_id !== user.id && u.rows[0]?.role !== 'admin') { + return Response.json({ error: '无权限删除此回复' }, { status: 403 }); + } + await pool.query('DELETE FROM replies WHERE id = $1', [params.id]); + return Response.json({ success: true }); + } catch { + return Response.json({ error: '删除失败,请稍后重试' }, { status: 500 }); + } +} diff --git a/app/api/reports/[id]/route.js b/app/api/reports/[id]/route.js new file mode 100644 index 0000000..5727bfd --- /dev/null +++ b/app/api/reports/[id]/route.js @@ -0,0 +1,33 @@ +// PUT /api/reports/[id] +import pool from '@/lib/db'; +import { getUser, requireAdmin } from '@/lib/auth'; + +const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i; + +export async function PUT(req, { params }) { + if (!UUID_RE.test(params.id)) { + return Response.json({ error: '操作失败,请稍后重试' }, { status: 404 }); + } + const user = getUser(req); + if (!user) { + return Response.json({ error: '请先登录' }, { status: 401 }); + } + const forbidden = await requireAdmin(user); + if (forbidden) return forbidden; + + const { status, note } = await req.json(); + if (!['pending', 'approved', 'rejected'].includes(status)) { + return Response.json({ error: '无效的状态' }, { status: 400 }); + } + try { + await pool.query( + `UPDATE reports + SET status = $1, handled_at = NOW(), handler_id = $2, handler_note = $3 + WHERE id = $4`, + [status, user.id, note || '', params.id] + ); + return Response.json({ success: true }); + } catch { + return Response.json({ error: '操作失败,请稍后重试' }, { status: 500 }); + } +} diff --git a/app/api/reports/route.js b/app/api/reports/route.js new file mode 100644 index 0000000..3828598 --- /dev/null +++ b/app/api/reports/route.js @@ -0,0 +1,55 @@ +// GET /api/reports, POST /api/reports +import pool from '@/lib/db'; +import { getUser, requireAdmin } from '@/lib/auth'; + +export async function GET(req) { + const user = getUser(req); + const forbidden = await requireAdmin(user); + if (forbidden) return forbidden; + try { + const r = await pool.query(` + SELECT + r.*, + reporter.username as reporter_name, + handler.username as handler_name, + p.title as post_title, + p.content as post_content + FROM reports r + JOIN users reporter ON r.reporter_id = reporter.id + LEFT JOIN users handler ON r.handler_id = handler.id + LEFT JOIN posts p ON r.post_id = p.id + ORDER BY r.created_at DESC + `); + return Response.json(r.rows); + } catch { + return Response.json({ error: '服务器错误' }, { status: 500 }); + } +} + +export async function POST(req) { + const user = getUser(req); + if (!user) { + return Response.json({ error: '请先登录' }, { status: 401 }); + } + const { post_id, reason } = await req.json(); + if (!post_id || !reason) { + return Response.json({ error: '请填写完整信息' }, { status: 400 }); + } + try { + const existing = await pool.query( + 'SELECT id FROM reports WHERE post_id = $1 AND reporter_id = $2 AND status = $3', + [post_id, user.id, 'pending'] + ); + if (existing.rows.length > 0) { + return Response.json({ error: '你已经举报过此帖子,请等待处理' }, { status: 400 }); + } + await pool.query( + `INSERT INTO reports (post_id, reporter_id, reason) + VALUES ($1, $2, $3)`, + [post_id, user.id, reason] + ); + return Response.json({ success: true }); + } catch { + return Response.json({ error: '举报失败,请稍后重试' }, { status: 500 }); + } +} diff --git a/app/api/settings/route.js b/app/api/settings/route.js new file mode 100644 index 0000000..e736c09 --- /dev/null +++ b/app/api/settings/route.js @@ -0,0 +1,35 @@ +// GET /api/settings, PUT /api/settings +import pool from '@/lib/db'; +import { getUser, requireAdmin } from '@/lib/auth'; + +export async function GET() { + try { + const r = await pool.query('SELECT key, value FROM settings'); + const settings = {}; + r.rows.forEach((row) => { settings[row.key] = row.value; }); + return Response.json(settings); + } catch { + return Response.json({ error: '服务器错误' }, { status: 500 }); + } +} + +export async function PUT(req) { + const user = getUser(req); + const forbidden = await requireAdmin(user); + if (forbidden) return forbidden; + + const { forum_name } = await req.json(); + if (!forum_name || forum_name.trim().length === 0) { + return Response.json({ error: '论坛名称不能为空' }, { status: 400 }); + } + try { + await pool.query( + `INSERT INTO settings (key, value) VALUES ($1, $2) + ON CONFLICT (key) DO UPDATE SET value = $2, updated_at = NOW()`, + ['forum_name', forum_name.trim()] + ); + return Response.json({ success: true }); + } catch { + return Response.json({ error: '更新失败,请稍后重试' }, { status: 500 }); + } +} diff --git a/app/api/stats/route.js b/app/api/stats/route.js new file mode 100644 index 0000000..14bd942 --- /dev/null +++ b/app/api/stats/route.js @@ -0,0 +1,19 @@ +// GET /api/stats +import pool from '@/lib/db'; + +export async function GET() { + try { + const [postsRes, usersRes] = await Promise.all([ + pool.query('SELECT COUNT(*) FROM posts'), + pool.query('SELECT COUNT(*) FROM users'), + ]); + return Response.json({ + posts: parseInt(postsRes.rows[0].count) || 0, + users: parseInt(usersRes.rows[0].count) || 0, + topics: parseInt(postsRes.rows[0].count) || 0, + online: Math.floor(Math.random() * 20) + 5, + }); + } catch { + return Response.json({ error: '服务器错误' }, { status: 500 }); + } +} diff --git a/app/api/upload/route.js b/app/api/upload/route.js new file mode 100644 index 0000000..f8a2721 --- /dev/null +++ b/app/api/upload/route.js @@ -0,0 +1,40 @@ +// POST /api/upload — 图片上传 (multipart/form-data) +import { writeFile, mkdir } from 'fs/promises'; +import path from 'path'; +import { getUser } from '@/lib/auth'; + +const ALLOWED = ['image/jpeg', 'image/png', 'image/gif', 'image/webp']; +const MAX_SIZE = 5 * 1024 * 1024; + +export const runtime = 'nodejs'; + +export async function POST(req) { + const user = getUser(req); + if (!user) { + return Response.json({ error: '请先登录' }, { status: 401 }); + } + + const form = await req.formData(); + const file = form.get('file'); + if (!file || typeof file === 'string') { + return Response.json({ error: '请选择图片' }, { status: 400 }); + } + if (!ALLOWED.includes(file.type)) { + return Response.json({ error: '不支持的图片格式' }, { status: 400 }); + } + if (file.size > MAX_SIZE) { + return Response.json({ error: '图片大小不能超过 5MB' }, { status: 400 }); + } + + try { + const ext = path.extname(file.name) || '.png'; + const name = Date.now() + '-' + Math.round(Math.random() * 10000) + ext; + const dir = path.join(process.cwd(), 'uploads'); + await mkdir(dir, { recursive: true }); + const buffer = Buffer.from(await file.arrayBuffer()); + await writeFile(path.join(dir, name), buffer); + return Response.json({ url: '/uploads/' + name }); + } catch { + return Response.json({ error: '上传失败,请稍后重试' }, { status: 500 }); + } +} diff --git a/app/api/users/[id]/role/route.js b/app/api/users/[id]/role/route.js new file mode 100644 index 0000000..e302404 --- /dev/null +++ b/app/api/users/[id]/role/route.js @@ -0,0 +1,27 @@ +// PUT /api/users/[id]/role (admin 改角色) +import pool from '@/lib/db'; +import { getUser, requireAdmin } from '@/lib/auth'; + +export async function PUT(req, { params }) { + const { id } = params; + const user = getUser(req); + if (!user) { + return Response.json({ error: '请先登录' }, { status: 401 }); + } + const forbidden = await requireAdmin(user); + if (forbidden) return forbidden; + + const { role } = await req.json(); + if (!['user', 'admin'].includes(role)) { + return Response.json({ error: '无效的角色' }, { status: 400 }); + } + if (id === user.id) { + return Response.json({ error: '不能修改自己的角色' }, { status: 400 }); + } + try { + await pool.query('UPDATE users SET role = $1 WHERE id = $2', [role, id]); + return Response.json({ success: true }); + } catch { + return Response.json({ error: '服务器错误' }, { status: 500 }); + } +} diff --git a/app/api/users/[id]/route.js b/app/api/users/[id]/route.js new file mode 100644 index 0000000..0559962 --- /dev/null +++ b/app/api/users/[id]/route.js @@ -0,0 +1,46 @@ +// PUT /api/users/[id] (更新资料), PUT /api/users/[id]/role (改角色) +import pool from '@/lib/db'; +import { getUser, requireAdmin } from '@/lib/auth'; + +export async function PUT(req, { params }) { + const { id } = params; + const user = getUser(req); + if (!user) { + return Response.json({ error: '请先登录' }, { status: 401 }); + } + + const body = await req.json(); + const { username, bio, role } = body; + + // 改角色:仅管理员 + if (role !== undefined) { + const forbidden = await requireAdmin(user); + if (forbidden) return forbidden; + if (!['user', 'admin'].includes(role)) { + return Response.json({ error: '无效的角色' }, { status: 400 }); + } + if (id === user.id) { + return Response.json({ error: '不能修改自己的角色' }, { status: 400 }); + } + try { + await pool.query('UPDATE users SET role = $1 WHERE id = $2', [role, id]); + return Response.json({ success: true }); + } catch { + return Response.json({ error: '服务器错误' }, { status: 500 }); + } + } + + // 更新资料:仅本人 + if (id !== user.id) { + return Response.json({ error: '无权限修改他人资料' }, { status: 403 }); + } + try { + await pool.query('UPDATE users SET username = $1, bio = $2 WHERE id = $3', [username, bio || '', id]); + return Response.json({ success: true }); + } catch (err) { + if (err.code === '23505') { + return Response.json({ error: '用户名已被占用' }, { status: 400 }); + } + return Response.json({ error: '服务器错误' }, { status: 500 }); + } +} diff --git a/app/api/users/route.js b/app/api/users/route.js new file mode 100644 index 0000000..ab74011 --- /dev/null +++ b/app/api/users/route.js @@ -0,0 +1,17 @@ +// GET /api/users (admin) +import pool from '@/lib/db'; +import { getUser, requireAdmin } from '@/lib/auth'; + +export async function GET(req) { + const user = getUser(req); + const forbidden = await requireAdmin(user); + if (forbidden) return forbidden; + try { + const r = await pool.query( + 'SELECT id, username, avatar_url, bio, role, created_at FROM users ORDER BY created_at DESC' + ); + return Response.json(r.rows); + } catch { + return Response.json({ error: '服务器错误' }, { status: 500 }); + } +} diff --git a/style.css b/app/globals.css similarity index 99% rename from style.css rename to app/globals.css index a302503..729252e 100644 --- a/style.css +++ b/app/globals.css @@ -1104,11 +1104,7 @@ svg { } } -@media (max-width: 480px) { - .forum-name { - font-size: - - /* ===== 独立页面内容居中 ===== */ +/* ===== 独立页面内容居中 ===== */ .page-slide .page-header, .page-slide > div, #postDetailContent, diff --git a/app/layout.js b/app/layout.js new file mode 100644 index 0000000..b1a4dd4 --- /dev/null +++ b/app/layout.js @@ -0,0 +1,15 @@ +// 全局布局 +import './globals.css'; + +export const metadata = { + title: 'Forumlify', + description: 'Forumlify - 简洁优雅的现代社区系统', +}; + +export default function RootLayout({ children }) { + return ( + + {children} + + ); +} diff --git a/app/page.js b/app/page.js new file mode 100644 index 0000000..7da1a31 --- /dev/null +++ b/app/page.js @@ -0,0 +1,59 @@ +'use client'; + +// 主页:SPA 视图调度 (feed/post/new/admin/settings/messages) +import { useState } from 'react'; +import AppProvider, { useApp } from '@/components/AppProvider'; +import Navbar from '@/components/Navbar'; +import Sidebar from '@/components/Sidebar'; +import Feed from '@/components/Feed'; +import PostDetail from '@/components/PostDetail'; +import NewPost from '@/components/NewPost'; +import AdminPage from '@/components/AdminPage'; +import SettingsPage from '@/components/SettingsPage'; +import Modals from '@/components/Modals'; + +function HomeInner() { + const { view, currentPostId } = useApp(); + const [modal, setModal] = useState(null); // null | login | register | report + const [reportPostId, setReportPostId] = useState(null); + + const openModal = (m) => setModal(m); + const openReport = (postId) => { setReportPostId(postId); setModal('report'); }; + + return ( + <> + + +
+ + +
+ + {/* 独立页面 */} +
+ {view === 'post' && currentPostId && } + {view === 'new' && } + {view === 'admin' && } + {view === 'settings' && } + {view === 'messages' && ( +
+
+

消息

+
+

暂无消息

+
+ )} +
+ + setModal(null)} reportPostId={reportPostId} /> + + ); +} + +export default function Home() { + return ( + + + + ); +} diff --git a/bun.lock b/bun.lock new file mode 100644 index 0000000..e6b2c01 --- /dev/null +++ b/bun.lock @@ -0,0 +1,246 @@ +{ + "lockfileVersion": 1, + "configVersion": 1, + "workspaces": { + "": { + "name": "forumlify", + "dependencies": { + "bcrypt": "^5.1.1", + "jsonwebtoken": "^9.0.2", + "next": "^14.2.15", + "pg": "^8.11.3", + "react": "^18.3.1", + "react-dom": "^18.3.1", + }, + }, + }, + "packages": { + "@mapbox/node-pre-gyp": ["@mapbox/node-pre-gyp@1.0.11", "https://registry.npmmirror.com/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.11.tgz", { "dependencies": { "detect-libc": "^2.0.0", "https-proxy-agent": "^5.0.0", "make-dir": "^3.1.0", "node-fetch": "^2.6.7", "nopt": "^5.0.0", "npmlog": "^5.0.1", "rimraf": "^3.0.2", "semver": "^7.3.5", "tar": "^6.1.11" }, "bin": { "node-pre-gyp": "bin/node-pre-gyp" } }, "sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ=="], + + "@next/env": ["@next/env@14.2.35", "", {}, "sha512-DuhvCtj4t9Gwrx80dmz2F4t/zKQ4ktN8WrMwOuVzkJfBilwAwGr6v16M5eI8yCuZ63H9TTuEU09Iu2HqkzFPVQ=="], + + "@next/swc-darwin-arm64": ["@next/swc-darwin-arm64@14.2.33", "", { "os": "darwin", "cpu": "arm64" }, "sha512-HqYnb6pxlsshoSTubdXKu15g3iivcbsMXg4bYpjL2iS/V6aQot+iyF4BUc2qA/J/n55YtvE4PHMKWBKGCF/+wA=="], + + "@next/swc-darwin-x64": ["@next/swc-darwin-x64@14.2.33", "", { "os": "darwin", "cpu": "x64" }, "sha512-8HGBeAE5rX3jzKvF593XTTFg3gxeU4f+UWnswa6JPhzaR6+zblO5+fjltJWIZc4aUalqTclvN2QtTC37LxvZAA=="], + + "@next/swc-linux-arm64-gnu": ["@next/swc-linux-arm64-gnu@14.2.33", "", { "os": "linux", "cpu": "arm64" }, "sha512-JXMBka6lNNmqbkvcTtaX8Gu5by9547bukHQvPoLe9VRBx1gHwzf5tdt4AaezW85HAB3pikcvyqBToRTDA4DeLw=="], + + "@next/swc-linux-arm64-musl": ["@next/swc-linux-arm64-musl@14.2.33", "", { "os": "linux", "cpu": "arm64" }, "sha512-Bm+QulsAItD/x6Ih8wGIMfRJy4G73tu1HJsrccPW6AfqdZd0Sfm5Imhgkgq2+kly065rYMnCOxTBvmvFY1BKfg=="], + + "@next/swc-linux-x64-gnu": ["@next/swc-linux-x64-gnu@14.2.33", "", { "os": "linux", "cpu": "x64" }, "sha512-FnFn+ZBgsVMbGDsTqo8zsnRzydvsGV8vfiWwUo1LD8FTmPTdV+otGSWKc4LJec0oSexFnCYVO4hX8P8qQKaSlg=="], + + "@next/swc-linux-x64-musl": ["@next/swc-linux-x64-musl@14.2.33", "", { "os": "linux", "cpu": "x64" }, "sha512-345tsIWMzoXaQndUTDv1qypDRiebFxGYx9pYkhwY4hBRaOLt8UGfiWKr9FSSHs25dFIf8ZqIFaPdy5MljdoawA=="], + + "@next/swc-win32-arm64-msvc": ["@next/swc-win32-arm64-msvc@14.2.33", "", { "os": "win32", "cpu": "arm64" }, "sha512-nscpt0G6UCTkrT2ppnJnFsYbPDQwmum4GNXYTeoTIdsmMydSKFz9Iny2jpaRupTb+Wl298+Rh82WKzt9LCcqSQ=="], + + "@next/swc-win32-ia32-msvc": ["@next/swc-win32-ia32-msvc@14.2.33", "https://registry.npmmirror.com/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.2.33.tgz", { "os": "win32", "cpu": "ia32" }, "sha512-pc9LpGNKhJ0dXQhZ5QMmYxtARwwmWLpeocFmVG5Z0DzWq5Uf0izcI8tLc+qOpqxO1PWqZ5A7J1blrUIKrIFc7Q=="], + + "@next/swc-win32-x64-msvc": ["@next/swc-win32-x64-msvc@14.2.33", "", { "os": "win32", "cpu": "x64" }, "sha512-nOjfZMy8B94MdisuzZo9/57xuFVLHJaDj5e/xrduJp9CV2/HrfxTRH2fbyLe+K9QT41WBLUd4iXX3R7jBp0EUg=="], + + "@swc/counter": ["@swc/counter@0.1.3", "https://registry.npmmirror.com/@swc/counter/-/counter-0.1.3.tgz", {}, "sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ=="], + + "@swc/helpers": ["@swc/helpers@0.5.5", "", { "dependencies": { "@swc/counter": "^0.1.3", "tslib": "^2.4.0" } }, "sha512-KGYxvIOXcceOAbEk4bi/dVLEK9z8sZ0uBB3Il5b1rhfClSpcX0yfRO0KmTkqR2cnQDymwLB+25ZyMzICg/cm/A=="], + + "abbrev": ["abbrev@1.1.1", "https://registry.npmmirror.com/abbrev/-/abbrev-1.1.1.tgz", {}, "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q=="], + + "agent-base": ["agent-base@6.0.2", "https://registry.npmmirror.com/agent-base/-/agent-base-6.0.2.tgz", { "dependencies": { "debug": "4" } }, "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ=="], + + "ansi-regex": ["ansi-regex@5.0.1", "https://registry.npmmirror.com/ansi-regex/-/ansi-regex-5.0.1.tgz", {}, "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="], + + "aproba": ["aproba@2.1.0", "https://registry.npmmirror.com/aproba/-/aproba-2.1.0.tgz", {}, "sha512-tLIEcj5GuR2RSTnxNKdkK0dJ/GrC7P38sUkiDmDuHfsHmbagTFAxDVIBltoklXEVIQ/f14IL8IMJ5pn9Hez1Ew=="], + + "are-we-there-yet": ["are-we-there-yet@2.0.0", "https://registry.npmmirror.com/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz", { "dependencies": { "delegates": "^1.0.0", "readable-stream": "^3.6.0" } }, "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw=="], + + "balanced-match": ["balanced-match@1.0.2", "https://registry.npmmirror.com/balanced-match/-/balanced-match-1.0.2.tgz", {}, "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="], + + "bcrypt": ["bcrypt@5.1.1", "https://registry.npmmirror.com/bcrypt/-/bcrypt-5.1.1.tgz", { "dependencies": { "@mapbox/node-pre-gyp": "^1.0.11", "node-addon-api": "^5.0.0" } }, "sha512-AGBHOG5hPYZ5Xl9KXzU5iKq9516yEmvCKDg3ecP5kX2aB6UqTeXZxk2ELnDgDm6BQSMlLt9rDB4LoSMx0rYwww=="], + + "brace-expansion": ["brace-expansion@1.1.18", "https://registry.npmmirror.com/brace-expansion/-/brace-expansion-1.1.18.tgz", { "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, "sha512-Edep/X9fGqVNmzKBVsDYIOtD+z1tuezV70LBjdCst9Tqu76lsnvRiZ6oTic1n+/BIwX6QDGAO94PN4N2SADvtw=="], + + "buffer-equal-constant-time": ["buffer-equal-constant-time@1.0.1", "https://registry.npmmirror.com/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", {}, "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA=="], + + "busboy": ["busboy@1.6.0", "https://registry.npmmirror.com/busboy/-/busboy-1.6.0.tgz", { "dependencies": { "streamsearch": "^1.1.0" } }, "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA=="], + + "caniuse-lite": ["caniuse-lite@1.0.30001809", "https://registry.npmmirror.com/caniuse-lite/-/caniuse-lite-1.0.30001809.tgz", {}, "sha512-xxWVywk6a6Arlk+hymeycyn/VgqEfLDxupvhH/xiY5SJ/18kmi9o6MiO320DCUzypORHLtvh0I4i04tUhCNHNQ=="], + + "chownr": ["chownr@2.0.0", "https://registry.npmmirror.com/chownr/-/chownr-2.0.0.tgz", {}, "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ=="], + + "client-only": ["client-only@0.0.1", "", {}, "sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA=="], + + "color-support": ["color-support@1.1.3", "https://registry.npmmirror.com/color-support/-/color-support-1.1.3.tgz", { "bin": { "color-support": "bin.js" } }, "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg=="], + + "concat-map": ["concat-map@0.0.1", "https://registry.npmmirror.com/concat-map/-/concat-map-0.0.1.tgz", {}, "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg=="], + + "console-control-strings": ["console-control-strings@1.1.0", "https://registry.npmmirror.com/console-control-strings/-/console-control-strings-1.1.0.tgz", {}, "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ=="], + + "debug": ["debug@4.4.3", "https://registry.npmmirror.com/debug/-/debug-4.4.3.tgz", { "dependencies": { "ms": "^2.1.3" }, "peerDependencies": { "supports-color": "*" }, "optionalPeers": ["supports-color"] }, "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA=="], + + "delegates": ["delegates@1.0.0", "https://registry.npmmirror.com/delegates/-/delegates-1.0.0.tgz", {}, "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ=="], + + "detect-libc": ["detect-libc@2.1.2", "https://registry.npmmirror.com/detect-libc/-/detect-libc-2.1.2.tgz", {}, "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ=="], + + "ecdsa-sig-formatter": ["ecdsa-sig-formatter@1.0.11", "https://registry.npmmirror.com/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", { "dependencies": { "safe-buffer": "^5.0.1" } }, "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ=="], + + "emoji-regex": ["emoji-regex@8.0.0", "https://registry.npmmirror.com/emoji-regex/-/emoji-regex-8.0.0.tgz", {}, "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="], + + "fs-minipass": ["fs-minipass@2.1.0", "https://registry.npmmirror.com/fs-minipass/-/fs-minipass-2.1.0.tgz", { "dependencies": { "minipass": "^3.0.0" } }, "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg=="], + + "fs.realpath": ["fs.realpath@1.0.0", "https://registry.npmmirror.com/fs.realpath/-/fs.realpath-1.0.0.tgz", {}, "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw=="], + + "gauge": ["gauge@3.0.2", "https://registry.npmmirror.com/gauge/-/gauge-3.0.2.tgz", { "dependencies": { "aproba": "^1.0.3 || ^2.0.0", "color-support": "^1.1.2", "console-control-strings": "^1.0.0", "has-unicode": "^2.0.1", "object-assign": "^4.1.1", "signal-exit": "^3.0.0", "string-width": "^4.2.3", "strip-ansi": "^6.0.1", "wide-align": "^1.1.2" } }, "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q=="], + + "glob": ["glob@7.2.3", "https://registry.npmmirror.com/glob/-/glob-7.2.3.tgz", { "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", "minimatch": "^3.1.1", "once": "^1.3.0", "path-is-absolute": "^1.0.0" } }, "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q=="], + + "graceful-fs": ["graceful-fs@4.2.11", "https://registry.npmmirror.com/graceful-fs/-/graceful-fs-4.2.11.tgz", {}, "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ=="], + + "has-unicode": ["has-unicode@2.0.1", "https://registry.npmmirror.com/has-unicode/-/has-unicode-2.0.1.tgz", {}, "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ=="], + + "https-proxy-agent": ["https-proxy-agent@5.0.1", "https://registry.npmmirror.com/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", { "dependencies": { "agent-base": "6", "debug": "4" } }, "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA=="], + + "inflight": ["inflight@1.0.6", "https://registry.npmmirror.com/inflight/-/inflight-1.0.6.tgz", { "dependencies": { "once": "^1.3.0", "wrappy": "1" } }, "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA=="], + + "inherits": ["inherits@2.0.4", "https://registry.npmmirror.com/inherits/-/inherits-2.0.4.tgz", {}, "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="], + + "is-fullwidth-code-point": ["is-fullwidth-code-point@3.0.0", "https://registry.npmmirror.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", {}, "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg=="], + + "js-tokens": ["js-tokens@4.0.0", "https://registry.npmmirror.com/js-tokens/-/js-tokens-4.0.0.tgz", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="], + + "jsonwebtoken": ["jsonwebtoken@9.0.3", "https://registry.npmmirror.com/jsonwebtoken/-/jsonwebtoken-9.0.3.tgz", { "dependencies": { "jws": "^4.0.1", "lodash.includes": "^4.3.0", "lodash.isboolean": "^3.0.3", "lodash.isinteger": "^4.0.4", "lodash.isnumber": "^3.0.3", "lodash.isplainobject": "^4.0.6", "lodash.isstring": "^4.0.1", "lodash.once": "^4.0.0", "ms": "^2.1.1", "semver": "^7.5.4" } }, "sha512-MT/xP0CrubFRNLNKvxJ2BYfy53Zkm++5bX9dtuPbqAeQpTVe0MQTFhao8+Cp//EmJp244xt6Drw/GVEGCUj40g=="], + + "jwa": ["jwa@2.0.1", "https://registry.npmmirror.com/jwa/-/jwa-2.0.1.tgz", { "dependencies": { "buffer-equal-constant-time": "^1.0.1", "ecdsa-sig-formatter": "1.0.11", "safe-buffer": "^5.0.1" } }, "sha512-hRF04fqJIP8Abbkq5NKGN0Bbr3JxlQ+qhZufXVr0DvujKy93ZCbXZMHDL4EOtodSbCWxOqR8MS1tXA5hwqCXDg=="], + + "jws": ["jws@4.0.1", "https://registry.npmmirror.com/jws/-/jws-4.0.1.tgz", { "dependencies": { "jwa": "^2.0.1", "safe-buffer": "^5.0.1" } }, "sha512-EKI/M/yqPncGUUh44xz0PxSidXFr/+r0pA70+gIYhjv+et7yxM+s29Y+VGDkovRofQem0fs7Uvf4+YmAdyRduA=="], + + "lodash.includes": ["lodash.includes@4.3.0", "https://registry.npmmirror.com/lodash.includes/-/lodash.includes-4.3.0.tgz", {}, "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w=="], + + "lodash.isboolean": ["lodash.isboolean@3.0.3", "https://registry.npmmirror.com/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", {}, "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg=="], + + "lodash.isinteger": ["lodash.isinteger@4.0.4", "https://registry.npmmirror.com/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", {}, "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA=="], + + "lodash.isnumber": ["lodash.isnumber@3.0.3", "https://registry.npmmirror.com/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", {}, "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw=="], + + "lodash.isplainobject": ["lodash.isplainobject@4.0.6", "https://registry.npmmirror.com/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", {}, "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA=="], + + "lodash.isstring": ["lodash.isstring@4.0.1", "https://registry.npmmirror.com/lodash.isstring/-/lodash.isstring-4.0.1.tgz", {}, "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw=="], + + "lodash.once": ["lodash.once@4.1.1", "https://registry.npmmirror.com/lodash.once/-/lodash.once-4.1.1.tgz", {}, "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg=="], + + "loose-envify": ["loose-envify@1.4.0", "https://registry.npmmirror.com/loose-envify/-/loose-envify-1.4.0.tgz", { "dependencies": { "js-tokens": "^3.0.0 || ^4.0.0" }, "bin": { "loose-envify": "cli.js" } }, "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q=="], + + "make-dir": ["make-dir@3.1.0", "https://registry.npmmirror.com/make-dir/-/make-dir-3.1.0.tgz", { "dependencies": { "semver": "^6.0.0" } }, "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw=="], + + "minimatch": ["minimatch@3.1.5", "https://registry.npmmirror.com/minimatch/-/minimatch-3.1.5.tgz", { "dependencies": { "brace-expansion": "^1.1.7" } }, "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w=="], + + "minipass": ["minipass@5.0.0", "https://registry.npmmirror.com/minipass/-/minipass-5.0.0.tgz", {}, "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ=="], + + "minizlib": ["minizlib@2.1.2", "https://registry.npmmirror.com/minizlib/-/minizlib-2.1.2.tgz", { "dependencies": { "minipass": "^3.0.0", "yallist": "^4.0.0" } }, "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg=="], + + "mkdirp": ["mkdirp@1.0.4", "https://registry.npmmirror.com/mkdirp/-/mkdirp-1.0.4.tgz", { "bin": { "mkdirp": "bin/cmd.js" } }, "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw=="], + + "ms": ["ms@2.1.3", "https://registry.npmmirror.com/ms/-/ms-2.1.3.tgz", {}, "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="], + + "nanoid": ["nanoid@3.3.18", "https://registry.npmmirror.com/nanoid/-/nanoid-3.3.18.tgz", { "bin": { "nanoid": "bin/nanoid.cjs" } }, "sha512-DTg4MJbGMWkfi6VZFdNt2/caMbQy4Ou+Op/hJQvGEWcnVfoA1QA+xzRKAzw9jD6+GVOOeYr/mIcuDSdug6F6+w=="], + + "next": ["next@14.2.35", "https://registry.npmmirror.com/next/-/next-14.2.35.tgz", { "dependencies": { "@next/env": "14.2.35", "@swc/helpers": "0.5.5", "busboy": "1.6.0", "caniuse-lite": "^1.0.30001579", "graceful-fs": "^4.2.11", "postcss": "8.4.31", "styled-jsx": "5.1.1" }, "optionalDependencies": { "@next/swc-darwin-arm64": "14.2.33", "@next/swc-darwin-x64": "14.2.33", "@next/swc-linux-arm64-gnu": "14.2.33", "@next/swc-linux-arm64-musl": "14.2.33", "@next/swc-linux-x64-gnu": "14.2.33", "@next/swc-linux-x64-musl": "14.2.33", "@next/swc-win32-arm64-msvc": "14.2.33", "@next/swc-win32-ia32-msvc": "14.2.33", "@next/swc-win32-x64-msvc": "14.2.33" }, "peerDependencies": { "@opentelemetry/api": "^1.1.0", "@playwright/test": "^1.41.2", "react": "^18.2.0", "react-dom": "^18.2.0", "sass": "^1.3.0" }, "optionalPeers": ["@opentelemetry/api", "@playwright/test", "sass"], "bin": { "next": "dist/bin/next" } }, "sha512-KhYd2Hjt/O1/1aZVX3dCwGXM1QmOV4eNM2UTacK5gipDdPN/oHHK/4oVGy7X8GMfPMsUTUEmGlsy0EY1YGAkig=="], + + "node-addon-api": ["node-addon-api@5.1.0", "https://registry.npmmirror.com/node-addon-api/-/node-addon-api-5.1.0.tgz", {}, "sha512-eh0GgfEkpnoWDq+VY8OyvYhFEzBk6jIYbRKdIlyTiAXIVJ8PyBaKb0rp7oDtoddbdoHWhq8wwr+XZ81F1rpNdA=="], + + "node-fetch": ["node-fetch@2.7.0", "https://registry.npmmirror.com/node-fetch/-/node-fetch-2.7.0.tgz", { "dependencies": { "whatwg-url": "^5.0.0" }, "peerDependencies": { "encoding": "^0.1.0" }, "optionalPeers": ["encoding"] }, "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A=="], + + "nopt": ["nopt@5.0.0", "https://registry.npmmirror.com/nopt/-/nopt-5.0.0.tgz", { "dependencies": { "abbrev": "1" }, "bin": { "nopt": "bin/nopt.js" } }, "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ=="], + + "npmlog": ["npmlog@5.0.1", "https://registry.npmmirror.com/npmlog/-/npmlog-5.0.1.tgz", { "dependencies": { "are-we-there-yet": "^2.0.0", "console-control-strings": "^1.1.0", "gauge": "^3.0.0", "set-blocking": "^2.0.0" } }, "sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw=="], + + "object-assign": ["object-assign@4.1.1", "https://registry.npmmirror.com/object-assign/-/object-assign-4.1.1.tgz", {}, "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg=="], + + "once": ["once@1.4.0", "https://registry.npmmirror.com/once/-/once-1.4.0.tgz", { "dependencies": { "wrappy": "1" } }, "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w=="], + + "path-is-absolute": ["path-is-absolute@1.0.1", "https://registry.npmmirror.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz", {}, "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg=="], + + "pg": ["pg@8.23.0", "https://registry.npmmirror.com/pg/-/pg-8.23.0.tgz", { "dependencies": { "pg-connection-string": "^2.14.0", "pg-pool": "^3.14.0", "pg-protocol": "^1.16.0", "pg-types": "2.2.0", "pgpass": "1.0.5" }, "optionalDependencies": { "pg-cloudflare": "^1.4.0" }, "peerDependencies": { "pg-native": ">=3.0.1" }, "optionalPeers": ["pg-native"] }, "sha512-Ip2EQCngowJLGOfCwkFhPXU7/ljlhn6Rxlmy4XYfL2Y+vyRM59+8uR2xqRWKdYmbXmxCFOAmKxBuSUCdF34qLg=="], + + "pg-cloudflare": ["pg-cloudflare@1.4.0", "https://registry.npmmirror.com/pg-cloudflare/-/pg-cloudflare-1.4.0.tgz", {}, "sha512-Vo7z/6rrQYxpNRylp4Tlob2elzbh+N/MOQbxFVWCxS7oEx6jF53GTJFxK2WWpKuBRkmiin4Mt+xofFDjx09R0A=="], + + "pg-connection-string": ["pg-connection-string@2.14.0", "https://registry.npmmirror.com/pg-connection-string/-/pg-connection-string-2.14.0.tgz", {}, "sha512-XwWDGcLRGCXAR8F/AM5bG7Q+A3Wm2s6QeEjlOKZLlH3UYcguiqCWKyWXVag5TLTIjR7oOJUY8kcADaZgWPyLeg=="], + + "pg-int8": ["pg-int8@1.0.1", "", {}, "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw=="], + + "pg-pool": ["pg-pool@3.14.0", "https://registry.npmmirror.com/pg-pool/-/pg-pool-3.14.0.tgz", { "peerDependencies": { "pg": ">=8.0" } }, "sha512-gKtPkFdQPU3DksooVLi9LsjZxrsBUZIpa+7aVx+LV5pNh0KzP4Zleud2po+ConrxbuXGBJ6Hfer6hdgpIBpBaw=="], + + "pg-protocol": ["pg-protocol@1.16.0", "https://registry.npmmirror.com/pg-protocol/-/pg-protocol-1.16.0.tgz", {}, "sha512-sILXutLVjCLjcDuOmvhX5e2Z4cS5qG/6Bu3VkpFwdf/633ElGLpEh9bgmuI5I4sqKqkifQiGyiCcx1HdtrK7tg=="], + + "pg-types": ["pg-types@2.2.0", "", { "dependencies": { "pg-int8": "1.0.1", "postgres-array": "~2.0.0", "postgres-bytea": "~1.0.0", "postgres-date": "~1.0.4", "postgres-interval": "^1.1.0" } }, "sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA=="], + + "pgpass": ["pgpass@1.0.5", "", { "dependencies": { "split2": "^4.1.0" } }, "sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug=="], + + "picocolors": ["picocolors@1.1.1", "https://registry.npmmirror.com/picocolors/-/picocolors-1.1.1.tgz", {}, "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA=="], + + "postcss": ["postcss@8.4.31", "https://registry.npmmirror.com/postcss/-/postcss-8.4.31.tgz", { "dependencies": { "nanoid": "^3.3.6", "picocolors": "^1.0.0", "source-map-js": "^1.0.2" } }, "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ=="], + + "postgres-array": ["postgres-array@2.0.0", "https://registry.npmmirror.com/postgres-array/-/postgres-array-2.0.0.tgz", {}, "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA=="], + + "postgres-bytea": ["postgres-bytea@1.0.1", "https://registry.npmmirror.com/postgres-bytea/-/postgres-bytea-1.0.1.tgz", {}, "sha512-5+5HqXnsZPE65IJZSMkZtURARZelel2oXUEO8rH83VS/hxH5vv1uHquPg5wZs8yMAfdv971IU+kcPUczi7NVBQ=="], + + "postgres-date": ["postgres-date@1.0.7", "https://registry.npmmirror.com/postgres-date/-/postgres-date-1.0.7.tgz", {}, "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q=="], + + "postgres-interval": ["postgres-interval@1.2.0", "https://registry.npmmirror.com/postgres-interval/-/postgres-interval-1.2.0.tgz", { "dependencies": { "xtend": "^4.0.0" } }, "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ=="], + + "react": ["react@18.3.1", "https://registry.npmmirror.com/react/-/react-18.3.1.tgz", { "dependencies": { "loose-envify": "^1.1.0" } }, "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ=="], + + "react-dom": ["react-dom@18.3.1", "https://registry.npmmirror.com/react-dom/-/react-dom-18.3.1.tgz", { "dependencies": { "loose-envify": "^1.1.0", "scheduler": "^0.23.2" }, "peerDependencies": { "react": "^18.3.1" } }, "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw=="], + + "readable-stream": ["readable-stream@3.6.2", "https://registry.npmmirror.com/readable-stream/-/readable-stream-3.6.2.tgz", { "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", "util-deprecate": "^1.0.1" } }, "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA=="], + + "rimraf": ["rimraf@3.0.2", "https://registry.npmmirror.com/rimraf/-/rimraf-3.0.2.tgz", { "dependencies": { "glob": "^7.1.3" }, "bin": { "rimraf": "bin.js" } }, "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA=="], + + "safe-buffer": ["safe-buffer@5.2.1", "https://registry.npmmirror.com/safe-buffer/-/safe-buffer-5.2.1.tgz", {}, "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="], + + "scheduler": ["scheduler@0.23.2", "https://registry.npmmirror.com/scheduler/-/scheduler-0.23.2.tgz", { "dependencies": { "loose-envify": "^1.1.0" } }, "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ=="], + + "semver": ["semver@7.8.5", "https://registry.npmmirror.com/semver/-/semver-7.8.5.tgz", { "bin": { "semver": "bin/semver.js" } }, "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA=="], + + "set-blocking": ["set-blocking@2.0.0", "https://registry.npmmirror.com/set-blocking/-/set-blocking-2.0.0.tgz", {}, "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw=="], + + "signal-exit": ["signal-exit@3.0.7", "https://registry.npmmirror.com/signal-exit/-/signal-exit-3.0.7.tgz", {}, "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ=="], + + "source-map-js": ["source-map-js@1.2.1", "https://registry.npmmirror.com/source-map-js/-/source-map-js-1.2.1.tgz", {}, "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA=="], + + "split2": ["split2@4.2.0", "https://registry.npmmirror.com/split2/-/split2-4.2.0.tgz", {}, "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg=="], + + "streamsearch": ["streamsearch@1.1.0", "https://registry.npmmirror.com/streamsearch/-/streamsearch-1.1.0.tgz", {}, "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg=="], + + "string-width": ["string-width@4.2.3", "https://registry.npmmirror.com/string-width/-/string-width-4.2.3.tgz", { "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" } }, "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g=="], + + "string_decoder": ["string_decoder@1.3.0", "https://registry.npmmirror.com/string_decoder/-/string_decoder-1.3.0.tgz", { "dependencies": { "safe-buffer": "~5.2.0" } }, "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA=="], + + "strip-ansi": ["strip-ansi@6.0.1", "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-6.0.1.tgz", { "dependencies": { "ansi-regex": "^5.0.1" } }, "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A=="], + + "styled-jsx": ["styled-jsx@5.1.1", "", { "dependencies": { "client-only": "0.0.1" }, "peerDependencies": { "react": ">= 16.8.0 || 17.x.x || ^18.0.0-0" } }, "sha512-pW7uC1l4mBZ8ugbiZrcIsiIvVx1UmTfw7UkC3Um2tmfUq9Bhk8IiyEIPl6F8agHgjzku6j0xQEZbfA5uSgSaCw=="], + + "tar": ["tar@6.2.1", "https://registry.npmmirror.com/tar/-/tar-6.2.1.tgz", { "dependencies": { "chownr": "^2.0.0", "fs-minipass": "^2.0.0", "minipass": "^5.0.0", "minizlib": "^2.1.1", "mkdirp": "^1.0.3", "yallist": "^4.0.0" } }, "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A=="], + + "tr46": ["tr46@0.0.3", "https://registry.npmmirror.com/tr46/-/tr46-0.0.3.tgz", {}, "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw=="], + + "tslib": ["tslib@2.8.1", "https://registry.npmmirror.com/tslib/-/tslib-2.8.1.tgz", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="], + + "util-deprecate": ["util-deprecate@1.0.2", "https://registry.npmmirror.com/util-deprecate/-/util-deprecate-1.0.2.tgz", {}, "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="], + + "webidl-conversions": ["webidl-conversions@3.0.1", "https://registry.npmmirror.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz", {}, "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ=="], + + "whatwg-url": ["whatwg-url@5.0.0", "https://registry.npmmirror.com/whatwg-url/-/whatwg-url-5.0.0.tgz", { "dependencies": { "tr46": "~0.0.3", "webidl-conversions": "^3.0.0" } }, "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw=="], + + "wide-align": ["wide-align@1.1.5", "https://registry.npmmirror.com/wide-align/-/wide-align-1.1.5.tgz", { "dependencies": { "string-width": "^1.0.2 || 2 || 3 || 4" } }, "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg=="], + + "wrappy": ["wrappy@1.0.2", "https://registry.npmmirror.com/wrappy/-/wrappy-1.0.2.tgz", {}, "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="], + + "xtend": ["xtend@4.0.2", "https://registry.npmmirror.com/xtend/-/xtend-4.0.2.tgz", {}, "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ=="], + + "yallist": ["yallist@4.0.0", "https://registry.npmmirror.com/yallist/-/yallist-4.0.0.tgz", {}, "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="], + + "fs-minipass/minipass": ["minipass@3.3.6", "https://registry.npmmirror.com/minipass/-/minipass-3.3.6.tgz", { "dependencies": { "yallist": "^4.0.0" } }, "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw=="], + + "make-dir/semver": ["semver@6.3.1", "https://registry.npmmirror.com/semver/-/semver-6.3.1.tgz", { "bin": { "semver": "bin/semver.js" } }, "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA=="], + + "minizlib/minipass": ["minipass@3.3.6", "https://registry.npmmirror.com/minipass/-/minipass-3.3.6.tgz", { "dependencies": { "yallist": "^4.0.0" } }, "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw=="], + } +} diff --git a/components/AdminPage.js b/components/AdminPage.js new file mode 100644 index 0000000..3be3144 --- /dev/null +++ b/components/AdminPage.js @@ -0,0 +1,47 @@ +'use client'; + +// 管理后台:5 个 tab +import { useState } from 'react'; +import AdminReports from './admin/AdminReports'; +import AdminUsers from './admin/AdminUsers'; +import AdminLogs from './admin/AdminLogs'; +import AdminLinks from './admin/AdminLinks'; +import AdminForumSettings from './admin/AdminForumSettings'; + +const TABS = [ + { key: 'reports', label: '举报' }, + { key: 'users', label: '用户' }, + { key: 'logs', label: '日志' }, + { key: 'links', label: '友链' }, + { key: 'settings', label: '论坛设置' }, +]; + +export default function AdminPage() { + const [tab, setTab] = useState('reports'); + + return ( +
+
+

管理后台

+
+
+ {TABS.map((t) => ( + + ))} +
+
+ {tab === 'reports' && } + {tab === 'users' && } + {tab === 'logs' && } + {tab === 'links' && } + {tab === 'settings' && } +
+
+ ); +} diff --git a/components/AppProvider.js b/components/AppProvider.js new file mode 100644 index 0000000..e00dd64 --- /dev/null +++ b/components/AppProvider.js @@ -0,0 +1,161 @@ +'use client'; + +// 全局状态 Provider:用户、主题、论坛名、当前视图(feed/post/new/admin/...) +import { createContext, useContext, useState, useEffect, useCallback, useRef } from 'react'; +import { API, getTheme, setToken, getToken } from '@/lib/api'; + +const AppContext = createContext(null); + +export function useApp() { + return useContext(AppContext); +} + +export default function AppProvider({ children }) { + const [currentUser, setCurrentUser] = useState(null); + const [forumName, setForumName] = useState('Forumlify'); + const [theme, setThemeState] = useState('light'); + const [view, setView] = useState('feed'); // feed | post | new | admin | settings | messages + const [currentPostId, setCurrentPostId] = useState(null); + const [sort, setSort] = useState('latest'); + const [refreshKey, setRefreshKey] = useState(0); + const loadedRef = useRef(false); + + const refresh = useCallback(() => setRefreshKey((k) => k + 1), []); + + // 主题 + useEffect(() => { + const t = getTheme(); + setThemeState(t); + document.documentElement.setAttribute('data-theme', t); + }, []); + + const toggleTheme = useCallback(() => { + setThemeState((prev) => { + const next = prev === 'light' ? 'dark' : 'light'; + document.documentElement.setAttribute('data-theme', next); + localStorage.setItem('forumlify-theme', next); + return next; + }); + }, []); + + // 初始化:恢复登录、加载论坛名 + useEffect(() => { + if (loadedRef.current) return; + loadedRef.current = true; + + async function init() { + const token = getToken(); + if (token) { + try { + const user = await API.getMe(); + setCurrentUser(user); + API.logEvent('login').catch(() => {}); + } catch { + setToken(null); + } + } + try { + const s = await API.getSettings(); + if (s.forum_name) setForumName(s.forum_name); + } catch { /* 用默认名 */ } + } + init(); + }, []); + + // 按 URL 参数初始化视图 + useEffect(() => { + const params = new URLSearchParams(window.location.search); + const postParam = params.get('post'); + const pageParam = params.get('page'); + if (postParam) { + setView('post'); + setCurrentPostId(postParam); + } else if (pageParam && ['messages', 'settings', 'admin', 'new'].includes(pageParam)) { + setView(pageParam); + } + }, []); + + // 视图切换:同步 URL (pushState,模拟原 SPA 行为) + const navigate = useCallback((page) => { + const url = new URL(window.location); + if (page === 'feed') { + url.searchParams.delete('page'); + url.searchParams.delete('post'); + } else { + url.searchParams.set('page', page); + url.searchParams.delete('post'); + } + window.history.pushState({ page }, '', url); + setView(page); + setCurrentPostId(null); + refresh(); + }, [refresh]); + + const openPost = useCallback((postId) => { + const url = new URL(window.location); + url.searchParams.set('post', postId); + url.searchParams.delete('page'); + window.history.pushState({ page: 'post', postId }, '', url); + setView('post'); + setCurrentPostId(postId); + }, []); + + // 浏览器前进后退 + useEffect(() => { + const onPop = (e) => { + const state = e.state || {}; + if (state.postId) { + setView('post'); + setCurrentPostId(state.postId); + } else { + setView(state.page || 'feed'); + setCurrentPostId(null); + } + }; + window.addEventListener('popstate', onPop); + return () => window.removeEventListener('popstate', onPop); + }, []); + + const login = useCallback(async (email, password) => { + const result = await API.login(email, password); + if (result.user) { + setCurrentUser(result.user); + API.logEvent('login').catch(() => {}); + } + return result; + }, []); + + const register = useCallback(async (email, password, username) => { + const result = await API.register(email, password, username); + const loginResult = await API.login(email, password); + if (loginResult.user) { + setCurrentUser(loginResult.user); + API.logEvent('register').catch(() => {}); + } + return result; + }, []); + + const logout = useCallback(() => { + API.logout(); + setCurrentUser(null); + navigate('feed'); + }, [navigate]); + + const updateForumName = useCallback((name) => { + setForumName(name); + document.title = name; + }, []); + + const value = { + currentUser, setCurrentUser, + forumName, updateForumName, + theme, toggleTheme, + view, navigate, + currentPostId, openPost, + sort, setSort, + refreshKey, refresh, + login, register, logout, + }; + + return {children}; +} diff --git a/components/Feed.js b/components/Feed.js new file mode 100644 index 0000000..5e4e0d0 --- /dev/null +++ b/components/Feed.js @@ -0,0 +1,105 @@ +'use client'; + +// 信息流:帖子列表 + 排序 tab + 发布新帖按钮 +import { useEffect, useState, useCallback } from 'react'; +import { API } from '@/lib/api'; +import { useApp } from './AppProvider'; + +function avatar(username) { + return 'https://ui-avatars.com/api/?name=' + encodeURIComponent(username || '匿名用户') + + '&background=6366f1&color=fff&size=64'; +} + +export default function Feed({ onOpenModal, onReport }) { + const { currentUser, sort, setSort, openPost, navigate, refreshKey } = useApp(); + const [posts, setPosts] = useState(null); // null = loading + const [error, setError] = useState(null); + + const load = useCallback(async () => { + setPosts(null); + setError(null); + try { + const data = await API.getPosts(sort); + setPosts(data || []); + } catch (err) { + setError(err.message); + setPosts([]); + } + }, [sort, refreshKey]); + + useEffect(() => { load(); }, [load]); + + const handleDelete = async (postId) => { + if (!confirm('确定要删除这条帖子吗?')) return; + try { + await API.deletePost(postId); + load(); + } catch (err) { + alert('删除失败:' + err.message); + } + }; + + return ( +
+
+
+ + +
+ +
+
+ {posts === null ? ( +
加载中...
+ ) : error ? ( +
加载失败:{error}
+ ) : posts.length === 0 ? ( +
✨ 还没有帖子,快来发布第一条吧!
+ ) : ( + posts.map((p) => { + const time = p.created_at ? new Date(p.created_at).toLocaleString('zh-CN') : ''; + return ( +
openPost(p.id)}> +
+ + {p.username || '匿名用户'} + {time} +
+
{p.title || '无标题'}
+
{(p.content || '').split('\n').map((l, i) => {l}
)}
+ {p.images && p.images.length > 0 && ( +
+ {p.images.map((img, i) => )} +
+ )} +
+ 💬 {p.reply_count || 0} + + {currentUser && currentUser.id === p.user_id && ( + + )} +
+
+ ); + }) + )} +
+
+ ); +} diff --git a/components/Modals.js b/components/Modals.js new file mode 100644 index 0000000..e909c98 --- /dev/null +++ b/components/Modals.js @@ -0,0 +1,142 @@ +'use client'; + +// 登录/注册/举报 模态框 +import { useState, useEffect } from 'react'; +import { API, generateCaptcha } from '@/lib/api'; +import { useApp } from './AppProvider'; + +export default function Modals({ modal, onClose, reportPostId }) { + const { login, register, currentUser, refresh } = useApp(); + + // 登录表单 + const [loginEmail, setLoginEmail] = useState(''); + const [loginPassword, setLoginPassword] = useState(''); + + // 注册表单 + const [regUsername, setRegUsername] = useState(''); + const [regEmail, setRegEmail] = useState(''); + const [regPassword, setRegPassword] = useState(''); + const [regCaptcha, setRegCaptcha] = useState(null); + const [regCaptchaInput, setRegCaptchaInput] = useState(''); + + // 举报表单 + const [reportReason, setReportReason] = useState('spam'); + + useEffect(() => { + if (modal === 'register') setRegCaptcha(generateCaptcha()); + }, [modal]); + + if (!modal) return null; + + const close = (e) => { + if (e && e.target !== e.currentTarget) return; + onClose(); + }; + + const handleLogin = async () => { + if (!loginEmail.trim() || !loginPassword) { alert('请填写完整信息'); return; } + try { + const result = await login(loginEmail.trim(), loginPassword); + if (result.user) { + onClose(); + setLoginEmail(''); + setLoginPassword(''); + refresh(); + } + } catch (err) { + alert('登录失败:' + err.message); + } + }; + + const handleRegister = async () => { + if (!regUsername.trim() || !regEmail.trim() || !regPassword) { alert('请填写完整信息'); return; } + if (regPassword.length < 6) { alert('密码至少6位'); return; } + if (!regCaptcha || parseInt(regCaptchaInput) !== regCaptcha.answer) { + alert('验证码错误,请重新计算'); + setRegCaptcha(generateCaptcha()); + setRegCaptchaInput(''); + return; + } + try { + await register(regEmail.trim(), regPassword, regUsername.trim()); + onClose(); + setRegUsername(''); + setRegEmail(''); + setRegPassword(''); + setRegCaptchaInput(''); + alert('注册成功!'); + refresh(); + } catch (err) { + alert('注册失败:' + err.message); + } + }; + + const handleReport = async () => { + if (!reportPostId) return; + try { + await API.createReport(reportPostId, reportReason); + onClose(); + alert('举报已提交,管理员将尽快处理'); + } catch (err) { + alert('举报失败:' + err.message); + } + }; + + return ( + <> + {modal === 'login' && ( +
+
+ ✕ +

登录

+ setLoginEmail(e.target.value)} /> + setLoginPassword(e.target.value)} + onKeyDown={(e) => { if (e.key === 'Enter') handleLogin(); }} /> + +
+
+ )} + + {modal === 'register' && ( +
+
+ ✕ +

注册

+ setRegUsername(e.target.value)} /> + setRegEmail(e.target.value)} /> + setRegPassword(e.target.value)} /> +
+ setRegCaptcha(generateCaptcha())} style={{ cursor: 'pointer' }}> + {regCaptcha ? regCaptcha.question : ''} + + setRegCaptchaInput(e.target.value)} /> +
+ +
+
+ )} + + {modal === 'report' && currentUser && ( +
+
+ ✕ +

举报帖子

+

请选择举报原因:

+ + +
+
+ )} + + ); +} diff --git a/components/Navbar.js b/components/Navbar.js new file mode 100644 index 0000000..3f803d2 --- /dev/null +++ b/components/Navbar.js @@ -0,0 +1,85 @@ +'use client'; + +// 导航栏:论坛名、登录/注册按钮、用户下拉菜单、主题切换 +import { useState } from 'react'; +import { useApp } from './AppProvider'; + +export default function Navbar({ onOpenModal }) { + const { currentUser, forumName, theme, toggleTheme, navigate, logout, setCurrentUser } = useApp(); + const [menuOpen, setMenuOpen] = useState(false); + + const avatarSrc = currentUser?.avatar_url || + 'https://ui-avatars.com/api/?name=' + encodeURIComponent(currentUser?.username || 'U') + + '&background=6366f1&color=fff'; + + const goPage = (page) => { + if (page === 'admin' && currentUser?.role !== 'admin') { + alert('无权限访问'); + return; + } + setMenuOpen(false); + navigate(page); + }; + + return ( + + ); +} diff --git a/components/NewPost.js b/components/NewPost.js new file mode 100644 index 0000000..eff4169 --- /dev/null +++ b/components/NewPost.js @@ -0,0 +1,118 @@ +'use client'; + +// 发布新帖页 +import { useState, useEffect } from 'react'; +import { API, generateCaptcha, uploadImage } from '@/lib/api'; +import { useApp } from './AppProvider'; + +export default function NewPost() { + const { currentUser, navigate, refresh } = useApp(); + const [title, setTitle] = useState(''); + const [content, setContent] = useState(''); + const [images, setImages] = useState([]); // 上传后的 URL 列表 + const [previews, setPreviews] = useState([]); // 本地预览 dataURL + const [captcha, setCaptcha] = useState(null); + const [captchaInput, setCaptchaInput] = useState(''); + const [uploading, setUploading] = useState(false); + + useEffect(() => { setCaptcha(generateCaptcha()); }, []); + + const handleFiles = async (files) => { + setUploading(true); + try { + const newPreviews = []; + for (const file of files) { + const dataUrl = await new Promise((resolve) => { + const reader = new FileReader(); + reader.onload = (e) => resolve(e.target.result); + reader.readAsDataURL(file); + }); + newPreviews.push(dataUrl); + // 直接上传拿 URL + const url = await uploadImage(file); + setImages((prev) => [...prev, url]); + } + setPreviews((prev) => [...prev, ...newPreviews]); + } catch (err) { + alert('上传失败:' + err.message); + } finally { + setUploading(false); + } + }; + + const handleSubmit = async () => { + if (!currentUser || !currentUser.id) { + alert('请先登录'); + navigate('feed'); + return; + } + if (!content.trim()) { alert('请填写内容'); return; } + if (!captcha || parseInt(captchaInput) !== captcha.answer) { + alert('验证码错误,请重新计算'); + setCaptcha(generateCaptcha()); + setCaptchaInput(''); + return; + } + try { + await API.createPost(title.trim() || '无标题', content.trim(), images); + API.logEvent('create_post').catch(() => {}); + alert('发布成功!'); + navigate('feed'); + refresh(); + } catch (err) { + alert('发布失败:' + err.message); + } + }; + + return ( +
+
+

发布新帖

+
+
+ setTitle(e.target.value)} + /> + - -
-
- -
- -
- - - - - -
-
-
加载中...
-
-
- -
- -
- - -
- -
- 3 + 5 = ? - -
- -
-
- - -
- -
-
加载中...
-
- -
- - - - - - - - - - - - - - - diff --git a/jsconfig.json b/jsconfig.json new file mode 100644 index 0000000..9c33383 --- /dev/null +++ b/jsconfig.json @@ -0,0 +1,8 @@ +{ + "compilerOptions": { + "baseUrl": ".", + "paths": { + "@/*": ["./*"] + } + } +} diff --git a/lib/api.js b/lib/api.js new file mode 100644 index 0000000..87585d6 --- /dev/null +++ b/lib/api.js @@ -0,0 +1,127 @@ +// 前端 API 封装 (替代原 index.html 的 apiFetch + API 对象) +// 所有调用返回 JSON;HTTP 错误时抛出带 error 消息的 Error + +const API_BASE_URL = '/api'; + +let token = null; +if (typeof window !== 'undefined') { + token = localStorage.getItem('forumlify-token') || null; +} + +export function getToken() { + return token; +} + +export function setToken(t) { + token = t; + if (t) localStorage.setItem('forumlify-token', t); + else localStorage.removeItem('forumlify-token'); +} + +async function apiFetch(path, options = {}) { + const headers = { ...(options.headers || {}) }; + if (options.body && typeof options.body === 'string') { + headers['Content-Type'] = 'application/json'; + } + if (token) headers['Authorization'] = 'Bearer ' + token; + const res = await fetch(API_BASE_URL + path, { ...options, headers }); + const data = await res.json().catch(() => ({})); + if (!res.ok || data.error) { + const err = new Error(data.error || '请求失败'); + err.status = res.status; + throw err; + } + return data; +} + +export const API = { + // 认证 + async login(email, password) { + const data = await apiFetch('/auth/login', { method: 'POST', body: JSON.stringify({ email, password }) }); + if (data.token) setToken(data.token); + return data; + }, + register(email, password, username) { + return apiFetch('/auth/register', { method: 'POST', body: JSON.stringify({ email, password, username }) }); + }, + logout() { setToken(null); }, + getMe() { return apiFetch('/auth/me'); }, + + // 帖子 + getPosts(sort) { return apiFetch('/posts?sort=' + (sort || 'latest')); }, + getPost(postId) { return apiFetch('/posts/' + postId); }, + createPost(title, content, images) { + return apiFetch('/posts', { method: 'POST', body: JSON.stringify({ title, content, images: images || [] }) }); + }, + deletePost(postId) { return apiFetch('/posts/' + postId, { method: 'DELETE' }); }, + + // 回复 + getReplies(postId) { return apiFetch('/posts/' + postId + '/replies'); }, + createReply(postId, content) { + return apiFetch('/posts/' + postId + '/replies', { method: 'POST', body: JSON.stringify({ content }) }); + }, + deleteReply(replyId) { return apiFetch('/replies/' + replyId, { method: 'DELETE' }); }, + + // 用户管理 + getUsers() { return apiFetch('/users'); }, + updateUserRole(userId, role) { + return apiFetch('/users/' + userId + '/role', { method: 'PUT', body: JSON.stringify({ role }) }); + }, + updateProfile(userId, username, bio) { + return apiFetch('/users/' + userId, { method: 'PUT', body: JSON.stringify({ username, bio }) }); + }, + + // 举报 + getReports() { return apiFetch('/reports'); }, + createReport(postId, reason) { + return apiFetch('/reports', { method: 'POST', body: JSON.stringify({ post_id: postId, reason }) }); + }, + updateReport(reportId, status, note) { + return apiFetch('/reports/' + reportId, { method: 'PUT', body: JSON.stringify({ status, note }) }); + }, + + // 统计 + 设置 + 友链 + getStats() { return apiFetch('/stats'); }, + getSettings() { return apiFetch('/settings'); }, + updateSettings(forum_name) { + return apiFetch('/settings', { method: 'PUT', body: JSON.stringify({ forum_name }) }); + }, + getLinks() { return apiFetch('/links'); }, + addLink(title, url) { + return apiFetch('/links', { method: 'POST', body: JSON.stringify({ title, url }) }); + }, + deleteLink(id) { return apiFetch('/links/' + id, { method: 'DELETE' }); }, + + // 事件日志 + getEventLogs() { return apiFetch('/event-logs'); }, + logEvent(action) { + return apiFetch('/event-logs', { method: 'POST', body: JSON.stringify({ action }) }).catch(() => {}); + }, +}; + +// 图片上传 (multipart) +export async function uploadImage(file) { + const fd = new FormData(); + fd.append('file', file); + const headers = {}; + if (token) headers['Authorization'] = 'Bearer ' + token; + const res = await fetch('/api/upload', { method: 'POST', body: fd, headers }); + const data = await res.json().catch(() => ({})); + if (!res.ok || data.error) throw new Error(data.error || '上传失败'); + return data.url; +} + +// 验证码 (10以内加减法,与原实现一致) +export function generateCaptcha() { + let a = Math.floor(Math.random() * 9) + 1; + let b = Math.floor(Math.random() * 9) + 1; + let op = ['+', '-'][Math.floor(Math.random() * 2)]; + if (op === '-' && a < b) { const t = a; a = b; b = t; } + return { question: a + ' ' + op + ' ' + b + ' = ?', answer: op === '+' ? a + b : a - b }; +} + +// 主题 +export function getTheme() { + if (typeof window === 'undefined') return 'light'; + return localStorage.getItem('forumlify-theme') || 'light'; +} diff --git a/lib/auth.js b/lib/auth.js new file mode 100644 index 0000000..87a348f --- /dev/null +++ b/lib/auth.js @@ -0,0 +1,42 @@ +// JWT 认证工具 (Route Handlers 共享) +import jwt from 'jsonwebtoken'; +import pool from './db'; + +const JWT_SECRET = process.env.JWT_SECRET || 'forumlify-secret-key-change-me-in-production'; + +export { JWT_SECRET }; + +// 从 Next.js Request 提取 Bearer token,解析并返回用户 payload +export function getUser(req) { + const auth = req.headers.get('authorization') || ''; + const token = auth.split(' ')[1]; + if (!token) return null; + try { + return jwt.verify(token, JWT_SECRET); + } catch { + return null; + } +} + +// 认证中间件:未登录返回 401 +export async function requireAuth(req) { + const user = getUser(req); + if (!user) { + return { user: null, error: Response.json({ error: '请先登录' }, { status: 401 }) }; + } + return { user, error: null }; +} + +// 管理员校验:非管理员返回 403 +export async function requireAdmin(user) { + if (!user) return Response.json({ error: '请先登录' }, { status: 401 }); + try { + const r = await pool.query('SELECT role FROM users WHERE id = $1', [user.id]); + if (r.rows[0]?.role !== 'admin') { + return Response.json({ error: '需要管理员权限' }, { status: 403 }); + } + return null; + } catch { + return Response.json({ error: '服务器错误' }, { status: 500 }); + } +} diff --git a/lib/db.js b/lib/db.js new file mode 100644 index 0000000..8af14e6 --- /dev/null +++ b/lib/db.js @@ -0,0 +1,12 @@ +// PostgreSQL 连接池单例 (Route Handlers 共享) +import { Pool } from 'pg'; + +const globalPool = globalThis.__forumlifyPool || new Pool({ + connectionString: process.env.DATABASE_URL || 'postgresql://forumlify:123456@localhost:5432/forumlify', +}); + +if (process.env.NODE_ENV !== 'production') { + globalThis.__forumlifyPool = globalPool; +} + +export default globalPool; diff --git a/next.config.js b/next.config.js new file mode 100644 index 0000000..403ee1c --- /dev/null +++ b/next.config.js @@ -0,0 +1,12 @@ +/** @type {import('next').NextConfig} */ +const nextConfig = { + output: 'standalone', + // /uploads/* 由 API 路由提供(上传文件运行时新增,不进 public 构建快照) + async rewrites() { + return [ + { source: '/uploads/:name', destination: '/api/uploads/:name' }, + ]; + }, +}; + +module.exports = nextConfig; diff --git a/package-lock.json b/package-lock.json index b7740d6..8776f9f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,25 +1,24 @@ { "name": "forumlify", - "version": "1.0.0", + "version": "2.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "forumlify", - "version": "1.0.0", + "version": "2.0.0", "dependencies": { "bcrypt": "^5.1.1", - "cors": "^2.8.5", - "express": "^4.18.2", "jsonwebtoken": "^9.0.2", - "multer": "^1.4.5-lts.1", - "pg": "^8.11.3" - } + "next": "^14.2.15", + "pg": "^8.11.3", + "react": "^18.3.1", + "react-dom": "^18.3.1" + }, + "devDependencies": {} }, "node_modules/@mapbox/node-pre-gyp": { "version": "1.0.11", - "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.11.tgz", - "integrity": "sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==", "license": "BSD-3-Clause", "dependencies": { "detect-libc": "^2.0.0", @@ -36,29 +35,42 @@ "node-pre-gyp": "bin/node-pre-gyp" } }, + "node_modules/@next/env": { + "version": "14.2.35", + "license": "MIT" + }, + "node_modules/@next/swc-darwin-arm64": { + "version": "14.2.33", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@swc/counter": { + "version": "0.1.3", + "license": "Apache-2.0" + }, + "node_modules/@swc/helpers": { + "version": "0.5.5", + "license": "Apache-2.0", + "dependencies": { + "@swc/counter": "^0.1.3", + "tslib": "^2.4.0" + } + }, "node_modules/abbrev": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", "license": "ISC" }, - "node_modules/accepts": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", - "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", - "license": "MIT", - "dependencies": { - "mime-types": "~2.1.34", - "negotiator": "0.6.3" - }, - "engines": { - "node": ">= 0.6" - } - }, "node_modules/agent-base": { "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", "license": "MIT", "dependencies": { "debug": "4" @@ -67,10 +79,111 @@ "node": ">= 6.0.0" } }, - "node_modules/agent-base/node_modules/debug": { + "node_modules/ansi-regex": { + "version": "5.0.1", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/aproba": { + "version": "2.1.0", + "license": "ISC" + }, + "node_modules/are-we-there-yet": { + "version": "2.0.0", + "license": "ISC", + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "license": "MIT" + }, + "node_modules/bcrypt": { + "version": "5.1.1", + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "@mapbox/node-pre-gyp": "^1.0.11", + "node-addon-api": "^5.0.0" + }, + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.18", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/buffer-equal-constant-time": { + "version": "1.0.1", + "license": "BSD-3-Clause" + }, + "node_modules/busboy": { + "version": "1.6.0", + "dependencies": { + "streamsearch": "^1.1.0" + }, + "engines": { + "node": ">=10.16.0" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001809", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0" + }, + "node_modules/chownr": { + "version": "2.0.0", + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/client-only": { + "version": "0.0.1", + "license": "MIT" + }, + "node_modules/color-support": { + "version": "1.1.3", + "license": "ISC", + "bin": { + "color-support": "bin.js" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "license": "MIT" + }, + "node_modules/console-control-strings": { + "version": "1.1.0", + "license": "ISC" + }, + "node_modules/debug": { "version": "4.4.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", - "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", "license": "MIT", "dependencies": { "ms": "^2.1.3" @@ -84,504 +197,30 @@ } } }, - "node_modules/agent-base/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "license": "MIT" - }, - "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/append-field": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/append-field/-/append-field-1.0.0.tgz", - "integrity": "sha512-klpgFSWLW1ZEs8svjfb7g4qWY0YS5imI82dTg+QahUvJ8YqAY0P10Uk8tTyh9ZGuYEZEMaeJYCF5BFuX552hsw==", - "license": "MIT" - }, - "node_modules/aproba": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.1.0.tgz", - "integrity": "sha512-tLIEcj5GuR2RSTnxNKdkK0dJ/GrC7P38sUkiDmDuHfsHmbagTFAxDVIBltoklXEVIQ/f14IL8IMJ5pn9Hez1Ew==", - "license": "ISC" - }, - "node_modules/are-we-there-yet": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz", - "integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==", - "deprecated": "This package is no longer supported.", - "license": "ISC", - "dependencies": { - "delegates": "^1.0.0", - "readable-stream": "^3.6.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/are-we-there-yet/node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "license": "MIT", - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/array-flatten": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", - "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", - "license": "MIT" - }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "license": "MIT" - }, - "node_modules/bcrypt": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/bcrypt/-/bcrypt-5.1.1.tgz", - "integrity": "sha512-AGBHOG5hPYZ5Xl9KXzU5iKq9516yEmvCKDg3ecP5kX2aB6UqTeXZxk2ELnDgDm6BQSMlLt9rDB4LoSMx0rYwww==", - "hasInstallScript": true, - "license": "MIT", - "dependencies": { - "@mapbox/node-pre-gyp": "^1.0.11", - "node-addon-api": "^5.0.0" - }, - "engines": { - "node": ">= 10.0.0" - } - }, - "node_modules/body-parser": { - "version": "1.20.6", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.6.tgz", - "integrity": "sha512-p5tAzS57i5MV9fZFDj9LeIiTZEufbSe2eDozP+ElheSUq1m74CRq1jI4mYNDdVs9vQztXFLuk/Gd6BWTdwRJ5g==", - "license": "MIT", - "dependencies": { - "bytes": "~3.1.2", - "content-type": "~1.0.5", - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "~1.2.0", - "http-errors": "~2.0.1", - "iconv-lite": "~0.4.24", - "on-finished": "~2.4.1", - "qs": "~6.15.1", - "raw-body": "~2.5.3", - "type-is": "~1.6.18", - "unpipe": "~1.0.0" - }, - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } - }, - "node_modules/brace-expansion": { - "version": "1.1.18", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.18.tgz", - "integrity": "sha512-Edep/X9fGqVNmzKBVsDYIOtD+z1tuezV70LBjdCst9Tqu76lsnvRiZ6oTic1n+/BIwX6QDGAO94PN4N2SADvtw==", - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/buffer-equal-constant-time": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", - "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==", - "license": "BSD-3-Clause" - }, - "node_modules/buffer-from": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "license": "MIT" - }, - "node_modules/busboy": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", - "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==", - "dependencies": { - "streamsearch": "^1.1.0" - }, - "engines": { - "node": ">=10.16.0" - } - }, - "node_modules/bytes": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", - "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/call-bind-apply-helpers": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", - "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/call-bound": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", - "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", - "license": "MIT", - "dependencies": { - "call-bind-apply-helpers": "^1.0.2", - "get-intrinsic": "^1.3.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/chownr": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", - "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", - "license": "ISC", - "engines": { - "node": ">=10" - } - }, - "node_modules/color-support": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", - "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", - "license": "ISC", - "bin": { - "color-support": "bin.js" - } - }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "license": "MIT" - }, - "node_modules/concat-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", - "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", - "engines": [ - "node >= 0.8" - ], - "license": "MIT", - "dependencies": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^2.2.2", - "typedarray": "^0.0.6" - } - }, - "node_modules/console-control-strings": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==", - "license": "ISC" - }, - "node_modules/content-disposition": { - "version": "0.5.4", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", - "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", - "license": "MIT", - "dependencies": { - "safe-buffer": "5.2.1" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/content-type": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", - "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/cookie": { - "version": "0.7.2", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", - "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/cookie-signature": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.7.tgz", - "integrity": "sha512-NXdYc3dLr47pBkpUCHtKSwIOQXLVn8dZEuywboCOJY/osA0wFSLlSawr3KN8qXJEyX66FcONTH8EIlVuK0yyFA==", - "license": "MIT" - }, - "node_modules/core-util-is": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", - "license": "MIT" - }, - "node_modules/cors": { - "version": "2.8.6", - "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.6.tgz", - "integrity": "sha512-tJtZBBHA6vjIAaF6EnIaq6laBBP9aq/Y3ouVJjEfoHbRBcHBAHYcMh/w8LDrk2PvIMMq8gmopa5D4V8RmbrxGw==", - "license": "MIT", - "dependencies": { - "object-assign": "^4", - "vary": "^1" - }, - "engines": { - "node": ">= 0.10" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - } - }, - "node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "license": "MIT", - "dependencies": { - "ms": "2.0.0" - } - }, "node_modules/delegates": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", - "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==", "license": "MIT" }, - "node_modules/depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/destroy": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", - "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", - "license": "MIT", - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } - }, "node_modules/detect-libc": { "version": "2.1.2", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", - "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", "license": "Apache-2.0", "engines": { "node": ">=8" } }, - "node_modules/dunder-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", - "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", - "license": "MIT", - "dependencies": { - "call-bind-apply-helpers": "^1.0.1", - "es-errors": "^1.3.0", - "gopd": "^1.2.0" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/ecdsa-sig-formatter": { "version": "1.0.11", - "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", - "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", "license": "Apache-2.0", "dependencies": { "safe-buffer": "^5.0.1" } }, - "node_modules/ee-first": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", - "license": "MIT" - }, "node_modules/emoji-regex": { "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "license": "MIT" }, - "node_modules/encodeurl": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", - "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/es-define-property": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", - "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-errors": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", - "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-object-atoms": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.2.tgz", - "integrity": "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==", - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", - "license": "MIT" - }, - "node_modules/etag": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/express": { - "version": "4.22.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.22.2.tgz", - "integrity": "sha512-IuL+Elrou2ZvCFHs18/CIzy2Nzvo25nZ1/D2eIZlz7c+QUayAcYoiM2BthCjs+EBHVpjYjcuLDAiCWgeIX3X1Q==", - "license": "MIT", - "dependencies": { - "accepts": "~1.3.8", - "array-flatten": "1.1.1", - "body-parser": "~1.20.5", - "content-disposition": "~0.5.4", - "content-type": "~1.0.4", - "cookie": "~0.7.1", - "cookie-signature": "~1.0.6", - "debug": "2.6.9", - "depd": "2.0.0", - "encodeurl": "~2.0.0", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "finalhandler": "~1.3.1", - "fresh": "~0.5.2", - "http-errors": "~2.0.0", - "merge-descriptors": "1.0.3", - "methods": "~1.1.2", - "on-finished": "~2.4.1", - "parseurl": "~1.3.3", - "path-to-regexp": "~0.1.12", - "proxy-addr": "~2.0.7", - "qs": "~6.15.1", - "range-parser": "~1.2.1", - "safe-buffer": "5.2.1", - "send": "~0.19.0", - "serve-static": "~1.16.2", - "setprototypeof": "1.2.0", - "statuses": "~2.0.1", - "type-is": "~1.6.18", - "utils-merge": "1.0.1", - "vary": "~1.1.2" - }, - "engines": { - "node": ">= 0.10.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - } - }, - "node_modules/finalhandler": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.2.tgz", - "integrity": "sha512-aA4RyPcd3badbdABGDuTXCMTtOneUCAYH/gxoYRTZlIJdF0YPWuGqiAsIrhNnnqdXGswYk6dGujem4w80UJFhg==", - "license": "MIT", - "dependencies": { - "debug": "2.6.9", - "encodeurl": "~2.0.0", - "escape-html": "~1.0.3", - "on-finished": "~2.4.1", - "parseurl": "~1.3.3", - "statuses": "~2.0.2", - "unpipe": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/forwarded": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", - "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/fresh": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, "node_modules/fs-minipass": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", - "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", "license": "ISC", "dependencies": { "minipass": "^3.0.0" @@ -592,8 +231,6 @@ }, "node_modules/fs-minipass/node_modules/minipass": { "version": "3.3.6", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", - "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", "license": "ISC", "dependencies": { "yallist": "^4.0.0" @@ -604,24 +241,10 @@ }, "node_modules/fs.realpath": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "license": "ISC" }, - "node_modules/function-bind": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/gauge": { "version": "3.0.2", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz", - "integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==", - "deprecated": "This package is no longer supported.", "license": "ISC", "dependencies": { "aproba": "^1.0.3 || ^2.0.0", @@ -638,48 +261,8 @@ "node": ">=10" } }, - "node_modules/get-intrinsic": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", - "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", - "license": "MIT", - "dependencies": { - "call-bind-apply-helpers": "^1.0.2", - "es-define-property": "^1.0.1", - "es-errors": "^1.3.0", - "es-object-atoms": "^1.1.1", - "function-bind": "^1.1.2", - "get-proto": "^1.0.1", - "gopd": "^1.2.0", - "has-symbols": "^1.1.0", - "hasown": "^2.0.2", - "math-intrinsics": "^1.1.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/get-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", - "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", - "license": "MIT", - "dependencies": { - "dunder-proto": "^1.0.1", - "es-object-atoms": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/glob": { "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", @@ -696,72 +279,16 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/gopd": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", - "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-symbols": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", - "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } + "node_modules/graceful-fs": { + "version": "4.2.11", + "license": "ISC" }, "node_modules/has-unicode": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==", "license": "ISC" }, - "node_modules/hasown": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz", - "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==", - "license": "MIT", - "dependencies": { - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/http-errors": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz", - "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==", - "license": "MIT", - "dependencies": { - "depd": "~2.0.0", - "inherits": "~2.0.4", - "setprototypeof": "~1.2.0", - "statuses": "~2.0.2", - "toidentifier": "~1.0.1" - }, - "engines": { - "node": ">= 0.8" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/express" - } - }, "node_modules/https-proxy-agent": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", - "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", "license": "MIT", "dependencies": { "agent-base": "6", @@ -771,46 +298,8 @@ "node": ">= 6" } }, - "node_modules/https-proxy-agent/node_modules/debug": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", - "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", - "license": "MIT", - "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/https-proxy-agent/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "license": "MIT" - }, - "node_modules/iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "license": "MIT", - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/inflight": { "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", "license": "ISC", "dependencies": { "once": "^1.3.0", @@ -819,38 +308,21 @@ }, "node_modules/inherits": { "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "license": "ISC" }, - "node_modules/ipaddr.js": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", - "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", - "license": "MIT", - "engines": { - "node": ">= 0.10" - } - }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "license": "MIT", "engines": { "node": ">=8" } }, - "node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "node_modules/js-tokens": { + "version": "4.0.0", "license": "MIT" }, "node_modules/jsonwebtoken": { "version": "9.0.3", - "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.3.tgz", - "integrity": "sha512-MT/xP0CrubFRNLNKvxJ2BYfy53Zkm++5bX9dtuPbqAeQpTVe0MQTFhao8+Cp//EmJp244xt6Drw/GVEGCUj40g==", "license": "MIT", "dependencies": { "jws": "^4.0.1", @@ -869,16 +341,8 @@ "npm": ">=6" } }, - "node_modules/jsonwebtoken/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "license": "MIT" - }, "node_modules/jwa": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.1.tgz", - "integrity": "sha512-hRF04fqJIP8Abbkq5NKGN0Bbr3JxlQ+qhZufXVr0DvujKy93ZCbXZMHDL4EOtodSbCWxOqR8MS1tXA5hwqCXDg==", "license": "MIT", "dependencies": { "buffer-equal-constant-time": "^1.0.1", @@ -888,8 +352,6 @@ }, "node_modules/jws": { "version": "4.0.1", - "resolved": "https://registry.npmjs.org/jws/-/jws-4.0.1.tgz", - "integrity": "sha512-EKI/M/yqPncGUUh44xz0PxSidXFr/+r0pA70+gIYhjv+et7yxM+s29Y+VGDkovRofQem0fs7Uvf4+YmAdyRduA==", "license": "MIT", "dependencies": { "jwa": "^2.0.1", @@ -898,50 +360,44 @@ }, "node_modules/lodash.includes": { "version": "4.3.0", - "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", - "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==", "license": "MIT" }, "node_modules/lodash.isboolean": { "version": "3.0.3", - "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", - "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==", "license": "MIT" }, "node_modules/lodash.isinteger": { "version": "4.0.4", - "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", - "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==", "license": "MIT" }, "node_modules/lodash.isnumber": { "version": "3.0.3", - "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", - "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==", "license": "MIT" }, "node_modules/lodash.isplainobject": { "version": "4.0.6", - "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", - "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==", "license": "MIT" }, "node_modules/lodash.isstring": { "version": "4.0.1", - "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", - "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==", "license": "MIT" }, "node_modules/lodash.once": { "version": "4.1.1", - "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", - "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==", "license": "MIT" }, + "node_modules/loose-envify": { + "version": "1.4.0", + "license": "MIT", + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, "node_modules/make-dir": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", "license": "MIT", "dependencies": { "semver": "^6.0.0" @@ -955,86 +411,13 @@ }, "node_modules/make-dir/node_modules/semver": { "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "license": "ISC", "bin": { "semver": "bin/semver.js" } }, - "node_modules/math-intrinsics": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", - "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/media-typer": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/merge-descriptors": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", - "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/methods": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", - "license": "MIT", - "bin": { - "mime": "cli.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "license": "MIT", - "dependencies": { - "mime-db": "1.52.0" - }, - "engines": { - "node": ">= 0.6" - } - }, "node_modules/minimatch": { "version": "3.1.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", - "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" @@ -1043,19 +426,8 @@ "node": "*" } }, - "node_modules/minimist": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", - "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/minipass": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", - "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", "license": "ISC", "engines": { "node": ">=8" @@ -1063,8 +435,6 @@ }, "node_modules/minizlib": { "version": "2.1.2", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", - "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", "license": "MIT", "dependencies": { "minipass": "^3.0.0", @@ -1076,8 +446,6 @@ }, "node_modules/minizlib/node_modules/minipass": { "version": "3.3.6", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", - "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", "license": "ISC", "dependencies": { "yallist": "^4.0.0" @@ -1087,61 +455,89 @@ } }, "node_modules/mkdirp": { - "version": "0.5.6", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", - "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "version": "1.0.4", "license": "MIT", - "dependencies": { - "minimist": "^1.2.6" - }, "bin": { "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" } }, "node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "version": "2.1.3", "license": "MIT" }, - "node_modules/multer": { - "version": "1.4.5-lts.2", - "resolved": "https://registry.npmjs.org/multer/-/multer-1.4.5-lts.2.tgz", - "integrity": "sha512-VzGiVigcG9zUAoCNU+xShztrlr1auZOlurXynNvO9GiWD1/mTBbUljOKY+qMeazBqXgRnjzeEgJI/wyjJUHg9A==", - "deprecated": "Multer 1.x is impacted by a number of vulnerabilities, which have been patched in 2.x. You should upgrade to the latest 2.x version.", + "node_modules/nanoid": { + "version": "3.3.18", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], "license": "MIT", - "dependencies": { - "append-field": "^1.0.0", - "busboy": "^1.0.0", - "concat-stream": "^1.5.2", - "mkdirp": "^0.5.4", - "object-assign": "^4.1.1", - "type-is": "^1.6.4", - "xtend": "^4.0.0" + "bin": { + "nanoid": "bin/nanoid.cjs" }, "engines": { - "node": ">= 6.0.0" + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, - "node_modules/negotiator": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", - "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "node_modules/next": { + "version": "14.2.35", "license": "MIT", + "dependencies": { + "@next/env": "14.2.35", + "@swc/helpers": "0.5.5", + "busboy": "1.6.0", + "caniuse-lite": "^1.0.30001579", + "graceful-fs": "^4.2.11", + "postcss": "8.4.31", + "styled-jsx": "5.1.1" + }, + "bin": { + "next": "dist/bin/next" + }, "engines": { - "node": ">= 0.6" + "node": ">=18.17.0" + }, + "optionalDependencies": { + "@next/swc-darwin-arm64": "14.2.33", + "@next/swc-darwin-x64": "14.2.33", + "@next/swc-linux-arm64-gnu": "14.2.33", + "@next/swc-linux-arm64-musl": "14.2.33", + "@next/swc-linux-x64-gnu": "14.2.33", + "@next/swc-linux-x64-musl": "14.2.33", + "@next/swc-win32-arm64-msvc": "14.2.33", + "@next/swc-win32-ia32-msvc": "14.2.33", + "@next/swc-win32-x64-msvc": "14.2.33" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.1.0", + "@playwright/test": "^1.41.2", + "react": "^18.2.0", + "react-dom": "^18.2.0", + "sass": "^1.3.0" + }, + "peerDependenciesMeta": { + "@opentelemetry/api": { + "optional": true + }, + "@playwright/test": { + "optional": true + }, + "sass": { + "optional": true + } } }, "node_modules/node-addon-api": { "version": "5.1.0", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-5.1.0.tgz", - "integrity": "sha512-eh0GgfEkpnoWDq+VY8OyvYhFEzBk6jIYbRKdIlyTiAXIVJ8PyBaKb0rp7oDtoddbdoHWhq8wwr+XZ81F1rpNdA==", "license": "MIT" }, "node_modules/node-fetch": { "version": "2.7.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", - "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", "license": "MIT", "dependencies": { "whatwg-url": "^5.0.0" @@ -1160,8 +556,6 @@ }, "node_modules/nopt": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", - "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", "license": "ISC", "dependencies": { "abbrev": "1" @@ -1175,9 +569,6 @@ }, "node_modules/npmlog": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz", - "integrity": "sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==", - "deprecated": "This package is no longer supported.", "license": "ISC", "dependencies": { "are-we-there-yet": "^2.0.0", @@ -1188,74 +579,27 @@ }, "node_modules/object-assign": { "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", "license": "MIT", "engines": { "node": ">=0.10.0" } }, - "node_modules/object-inspect": { - "version": "1.13.4", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", - "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/on-finished": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", - "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", - "license": "MIT", - "dependencies": { - "ee-first": "1.1.1" - }, - "engines": { - "node": ">= 0.8" - } - }, "node_modules/once": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", "license": "ISC", "dependencies": { "wrappy": "1" } }, - "node_modules/parseurl": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, "node_modules/path-is-absolute": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", "license": "MIT", "engines": { "node": ">=0.10.0" } }, - "node_modules/path-to-regexp": { - "version": "0.1.13", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.13.tgz", - "integrity": "sha512-A/AGNMFN3c8bOlvV9RreMdrv7jsmF9XIfDeCd87+I8RNg6s78BhJxMu69NEMHBSJFxKidViTEdruRwEk/WIKqA==", - "license": "MIT" - }, "node_modules/pg": { "version": "8.23.0", - "resolved": "https://registry.npmjs.org/pg/-/pg-8.23.0.tgz", - "integrity": "sha512-Ip2EQCngowJLGOfCwkFhPXU7/ljlhn6Rxlmy4XYfL2Y+vyRM59+8uR2xqRWKdYmbXmxCFOAmKxBuSUCdF34qLg==", "license": "MIT", "dependencies": { "pg-connection-string": "^2.14.0", @@ -1281,21 +625,15 @@ }, "node_modules/pg-cloudflare": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/pg-cloudflare/-/pg-cloudflare-1.4.0.tgz", - "integrity": "sha512-Vo7z/6rrQYxpNRylp4Tlob2elzbh+N/MOQbxFVWCxS7oEx6jF53GTJFxK2WWpKuBRkmiin4Mt+xofFDjx09R0A==", "license": "MIT", "optional": true }, "node_modules/pg-connection-string": { "version": "2.14.0", - "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.14.0.tgz", - "integrity": "sha512-XwWDGcLRGCXAR8F/AM5bG7Q+A3Wm2s6QeEjlOKZLlH3UYcguiqCWKyWXVag5TLTIjR7oOJUY8kcADaZgWPyLeg==", "license": "MIT" }, "node_modules/pg-int8": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz", - "integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==", "license": "ISC", "engines": { "node": ">=4.0.0" @@ -1303,8 +641,6 @@ }, "node_modules/pg-pool": { "version": "3.14.0", - "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.14.0.tgz", - "integrity": "sha512-gKtPkFdQPU3DksooVLi9LsjZxrsBUZIpa+7aVx+LV5pNh0KzP4Zleud2po+ConrxbuXGBJ6Hfer6hdgpIBpBaw==", "license": "MIT", "peerDependencies": { "pg": ">=8.0" @@ -1312,14 +648,10 @@ }, "node_modules/pg-protocol": { "version": "1.16.0", - "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.16.0.tgz", - "integrity": "sha512-sILXutLVjCLjcDuOmvhX5e2Z4cS5qG/6Bu3VkpFwdf/633ElGLpEh9bgmuI5I4sqKqkifQiGyiCcx1HdtrK7tg==", "license": "MIT" }, "node_modules/pg-types": { "version": "2.2.0", - "resolved": "https://registry.npmjs.org/pg-types/-/pg-types-2.2.0.tgz", - "integrity": "sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==", "license": "MIT", "dependencies": { "pg-int8": "1.0.1", @@ -1334,17 +666,43 @@ }, "node_modules/pgpass": { "version": "1.0.5", - "resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.5.tgz", - "integrity": "sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==", "license": "MIT", "dependencies": { "split2": "^4.1.0" } }, + "node_modules/picocolors": { + "version": "1.1.1", + "license": "ISC" + }, + "node_modules/postcss": { + "version": "8.4.31", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.6", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, "node_modules/postgres-array": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz", - "integrity": "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==", "license": "MIT", "engines": { "node": ">=4" @@ -1352,8 +710,6 @@ }, "node_modules/postgres-bytea": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.1.tgz", - "integrity": "sha512-5+5HqXnsZPE65IJZSMkZtURARZelel2oXUEO8rH83VS/hxH5vv1uHquPg5wZs8yMAfdv971IU+kcPUczi7NVBQ==", "license": "MIT", "engines": { "node": ">=0.10.0" @@ -1361,8 +717,6 @@ }, "node_modules/postgres-date": { "version": "1.0.7", - "resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz", - "integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==", "license": "MIT", "engines": { "node": ">=0.10.0" @@ -1370,8 +724,6 @@ }, "node_modules/postgres-interval": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz", - "integrity": "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==", "license": "MIT", "dependencies": { "xtend": "^4.0.0" @@ -1380,91 +732,41 @@ "node": ">=0.10.0" } }, - "node_modules/process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", - "license": "MIT" - }, - "node_modules/proxy-addr": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", - "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "node_modules/react": { + "version": "18.3.1", "license": "MIT", "dependencies": { - "forwarded": "0.2.0", - "ipaddr.js": "1.9.1" + "loose-envify": "^1.1.0" }, "engines": { - "node": ">= 0.10" + "node": ">=0.10.0" } }, - "node_modules/qs": { - "version": "6.15.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.15.3.tgz", - "integrity": "sha512-O9gl3zCl5h5blw1KGUzQKhA5oUXSl8rwUIM5o0S3nCXMliSvy5Dzx7/DJcI+SwgICv+IneSZwhBh1oSyEHA71A==", - "license": "BSD-3-Clause", - "dependencies": { - "es-define-property": "^1.0.1", - "side-channel": "^1.1.1" - }, - "engines": { - "node": ">=0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/range-parser": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", - "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/raw-body": { - "version": "2.5.3", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.3.tgz", - "integrity": "sha512-s4VSOf6yN0rvbRZGxs8Om5CWj6seneMwK3oDb4lWDH0UPhWcxwOWw5+qk24bxq87szX1ydrwylIOp2uG1ojUpA==", + "node_modules/react-dom": { + "version": "18.3.1", "license": "MIT", "dependencies": { - "bytes": "~3.1.2", - "http-errors": "~2.0.1", - "iconv-lite": "~0.4.24", - "unpipe": "~1.0.0" + "loose-envify": "^1.1.0", + "scheduler": "^0.23.2" }, - "engines": { - "node": ">= 0.8" + "peerDependencies": { + "react": "^18.3.1" } }, "node_modules/readable-stream": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "version": "3.6.2", "license": "MIT", "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" } }, - "node_modules/readable-stream/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "license": "MIT" - }, "node_modules/rimraf": { "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "deprecated": "Rimraf versions prior to v4 are no longer supported", "license": "ISC", "dependencies": { "glob": "^7.1.3" @@ -1478,8 +780,6 @@ }, "node_modules/safe-buffer": { "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", "funding": [ { "type": "github", @@ -1496,16 +796,15 @@ ], "license": "MIT" }, - "node_modules/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "license": "MIT" + "node_modules/scheduler": { + "version": "0.23.2", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.1.0" + } }, "node_modules/semver": { "version": "7.8.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", - "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", "license": "ISC", "bin": { "semver": "bin/semver.js" @@ -1514,186 +813,43 @@ "node": ">=10" } }, - "node_modules/send": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/send/-/send-0.19.2.tgz", - "integrity": "sha512-VMbMxbDeehAxpOtWJXlcUS5E8iXh6QmN+BkRX1GARS3wRaXEEgzCcB10gTQazO42tpNIya8xIyNx8fll1OFPrg==", - "license": "MIT", - "dependencies": { - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "encodeurl": "~2.0.0", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "fresh": "~0.5.2", - "http-errors": "~2.0.1", - "mime": "1.6.0", - "ms": "2.1.3", - "on-finished": "~2.4.1", - "range-parser": "~1.2.1", - "statuses": "~2.0.2" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/send/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "license": "MIT" - }, - "node_modules/serve-static": { - "version": "1.16.3", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.3.tgz", - "integrity": "sha512-x0RTqQel6g5SY7Lg6ZreMmsOzncHFU7nhnRWkKgWuMTu5NN0DR5oruckMqRvacAN9d5w6ARnRBXl9xhDCgfMeA==", - "license": "MIT", - "dependencies": { - "encodeurl": "~2.0.0", - "escape-html": "~1.0.3", - "parseurl": "~1.3.3", - "send": "~0.19.1" - }, - "engines": { - "node": ">= 0.8.0" - } - }, "node_modules/set-blocking": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", "license": "ISC" }, - "node_modules/setprototypeof": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", - "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", - "license": "ISC" - }, - "node_modules/side-channel": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.1.tgz", - "integrity": "sha512-6x6dK6zJdpTzF4sQeNYxwtvBzf6Eg4GtlesS94HOvTudUeyK2WXAaIfmDgsyslYrRBeFIlsi54AYsFGUuhmvrQ==", - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "object-inspect": "^1.13.4", - "side-channel-list": "^1.0.1", - "side-channel-map": "^1.0.1", - "side-channel-weakmap": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/side-channel-list": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.1.tgz", - "integrity": "sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w==", - "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "object-inspect": "^1.13.4" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/side-channel-map": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", - "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.5", - "object-inspect": "^1.13.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/side-channel-weakmap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", - "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", - "license": "MIT", - "dependencies": { - "call-bound": "^1.0.2", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.5", - "object-inspect": "^1.13.3", - "side-channel-map": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/signal-exit": { "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", "license": "ISC" }, + "node_modules/source-map-js": { + "version": "1.2.1", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/split2": { "version": "4.2.0", - "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", - "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==", "license": "ISC", "engines": { "node": ">= 10.x" } }, - "node_modules/statuses": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz", - "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, "node_modules/streamsearch": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", - "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==", "engines": { "node": ">=10.0.0" } }, "node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "version": "1.3.0", "license": "MIT", "dependencies": { - "safe-buffer": "~5.1.0" + "safe-buffer": "~5.2.0" } }, - "node_modules/string_decoder/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "license": "MIT" - }, "node_modules/string-width": { "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", @@ -1706,8 +862,6 @@ }, "node_modules/strip-ansi": { "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" @@ -1716,11 +870,29 @@ "node": ">=8" } }, + "node_modules/styled-jsx": { + "version": "5.1.1", + "license": "MIT", + "dependencies": { + "client-only": "0.0.1" + }, + "engines": { + "node": ">= 12.0.0" + }, + "peerDependencies": { + "react": ">= 16.8.0 || 17.x.x || ^18.0.0-0" + }, + "peerDependenciesMeta": { + "@babel/core": { + "optional": true + }, + "babel-plugin-macros": { + "optional": true + } + } + }, "node_modules/tar": { "version": "6.2.1", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", - "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==", - "deprecated": "Old versions of tar are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", "license": "ISC", "dependencies": { "chownr": "^2.0.0", @@ -1734,95 +906,24 @@ "node": ">=10" } }, - "node_modules/tar/node_modules/mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", - "license": "MIT", - "bin": { - "mkdirp": "bin/cmd.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/toidentifier": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", - "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", - "license": "MIT", - "engines": { - "node": ">=0.6" - } - }, "node_modules/tr46": { "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", "license": "MIT" }, - "node_modules/type-is": { - "version": "1.6.18", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", - "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", - "license": "MIT", - "dependencies": { - "media-typer": "0.3.0", - "mime-types": "~2.1.24" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/typedarray": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==", - "license": "MIT" - }, - "node_modules/unpipe": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } + "node_modules/tslib": { + "version": "2.8.1", + "license": "0BSD" }, "node_modules/util-deprecate": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", "license": "MIT" }, - "node_modules/utils-merge": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", - "license": "MIT", - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/vary": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", - "license": "MIT", - "engines": { - "node": ">= 0.8" - } - }, "node_modules/webidl-conversions": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", "license": "BSD-2-Clause" }, "node_modules/whatwg-url": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", "license": "MIT", "dependencies": { "tr46": "~0.0.3", @@ -1831,8 +932,6 @@ }, "node_modules/wide-align": { "version": "1.1.5", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", - "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", "license": "ISC", "dependencies": { "string-width": "^1.0.2 || 2 || 3 || 4" @@ -1840,14 +939,10 @@ }, "node_modules/wrappy": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", "license": "ISC" }, "node_modules/xtend": { "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", "license": "MIT", "engines": { "node": ">=0.4" @@ -1855,8 +950,6 @@ }, "node_modules/yallist": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "license": "ISC" } } diff --git a/package.json b/package.json index d37aaa2..80e3c91 100644 --- a/package.json +++ b/package.json @@ -1,18 +1,20 @@ { "name": "forumlify", - "version": "1.0.0", - "description": "Forumlify - 简洁优雅的现代社区系统", - "main": "server.js", + "version": "2.0.0", + "description": "Forumlify - 简洁优雅的现代社区系统 (Next.js)", + "private": true, "scripts": { - "start": "node server.js", - "dev": "node server.js" + "dev": "next dev -H 0.0.0.0", + "build": "next build", + "start": "node scripts/start.js" }, "dependencies": { "bcrypt": "^5.1.1", - "cors": "^2.8.5", - "express": "^4.18.2", "jsonwebtoken": "^9.0.2", - "multer": "^1.4.5-lts.1", - "pg": "^8.11.3" - } -} \ No newline at end of file + "next": "^14.2.15", + "pg": "^8.11.3", + "react": "^18.3.1", + "react-dom": "^18.3.1" + }, + "devDependencies": {} +} diff --git a/scripts/start.js b/scripts/start.js new file mode 100644 index 0000000..903abdb --- /dev/null +++ b/scripts/start.js @@ -0,0 +1,21 @@ +#!/usr/bin/env node +// Forumlify 启动入口 +// 从 config.js 读取 SERVER_HOST / SERVER_PORT(可选),未配置时用默认值: +// host = 环境变量 HOST > config.SERVER_HOST > '0.0.0.0' +// port = 环境变量 PORT > config.SERVER_PORT > 3000 +const { spawn } = require('child_process'); +const CONFIG = require('../config'); + +const host = process.env.HOST || CONFIG.SERVER_HOST || '0.0.0.0'; +const port = process.env.PORT || CONFIG.SERVER_PORT || 3000; + +const args = ['start', '-H', host, '-p', String(port)]; +const child = spawn(require.resolve('next/dist/bin/next'), args, { + stdio: 'inherit', + env: { ...process.env, HOSTNAME: host, PORT: String(port) }, +}); + +child.on('exit', (code, signal) => { + if (signal) process.kill(process.pid, signal); + else process.exit(code ?? 0); +}); diff --git a/server.js b/server.js deleted file mode 100644 index 0759a0c..0000000 --- a/server.js +++ /dev/null @@ -1,639 +0,0 @@ -// ============================================================ -// Forumlify 后端服务 -// 一个文件搞定所有 API + 文件服务 -// ============================================================ - -const express = require('express'); -const cors = require('cors'); -const bcrypt = require('bcrypt'); -const jwt = require('jsonwebtoken'); -const { Pool } = require('pg'); -const multer = require('multer'); -const path = require('path'); -const fs = require('fs'); - -const app = express(); - -// 服务端配置(config.js,浏览器端加载同名文件但不影响服务端) -const CONFIG = require('./config'); - -// 监听端口:环境变量 PORT 优先,其次 config.js 的 SERVER_PORT,最后默认 3000 -const PORT = process.env.PORT || CONFIG.SERVER_PORT || 3000; -const JWT_SECRET = process.env.JWT_SECRET || 'forumlify-secret-key-change-me-in-production'; - -// ============================================================ -// 数据库 -// ============================================================ -const pool = new Pool({ - connectionString: process.env.DATABASE_URL || 'postgresql://forumlify:123456@localhost:5432/forumlify', -}); - -// ============================================================ -// 中间件 -// ============================================================ -app.use(cors()); -app.use(express.json()); -app.use(express.urlencoded({ extended: true })); - -// 确保上传目录存在 -if (!fs.existsSync('uploads')) fs.mkdirSync('uploads'); -app.use('/uploads', express.static('uploads')); - -// ============================================================ -// 认证中间件 -// ============================================================ -const auth = (req, res, next) => { - const token = req.headers.authorization?.split(' ')[1]; - if (!token) { - return res.status(401).json({ error: '请先登录' }); - } - try { - const decoded = jwt.verify(token, JWT_SECRET); - req.user = decoded; - next(); - } catch (err) { - return res.status(401).json({ error: '登录已过期,请重新登录' }); - } -}; - -const admin = async (req, res, next) => { - try { - const r = await pool.query('SELECT role FROM users WHERE id = $1', [req.user.id]); - if (r.rows[0]?.role !== 'admin') { - return res.status(403).json({ error: '需要管理员权限' }); - } - next(); - } catch (err) { - res.status(500).json({ error: '服务器错误' }); - } -}; - -// ============================================================ -// 论坛设置接口(新增) -// ============================================================ - -// 获取论坛设置(公开) -app.get('/api/settings', async (req, res) => { - try { - const r = await pool.query('SELECT key, value FROM settings'); - const settings = {}; - r.rows.forEach(row => { settings[row.key] = row.value; }); - res.json(settings); - } catch (err) { - res.status(500).json({ error: '服务器错误' }); - } -}); - -// 更新论坛设置(管理员) -app.put('/api/settings', auth, admin, async (req, res) => { - const { forum_name } = req.body; - if (!forum_name || forum_name.trim().length === 0) { - return res.status(400).json({ error: '论坛名称不能为空' }); - } - try { - await pool.query( - `INSERT INTO settings (key, value) VALUES ($1, $2) - ON CONFLICT (key) DO UPDATE SET value = $2, updated_at = NOW()`, - ['forum_name', forum_name.trim()] - ); - res.json({ success: true }); - } catch (err) { - res.status(500).json({ error: '更新失败,请稍后重试' }); - } -}); - -// ============================================================ -// 认证接口 -// ============================================================ - -// 注册 - 第一个用户自动成为管理员 -app.post('/api/auth/register', async (req, res) => { - const { email, password, username } = req.body; - - if (!email || !password || !username) { - return res.status(400).json({ error: '请填写完整信息' }); - } - if (password.length < 6) { - return res.status(400).json({ error: '密码至少6位' }); - } - - try { - const countResult = await pool.query('SELECT COUNT(*) FROM users'); - const isFirstUser = parseInt(countResult.rows[0].count) === 0; - - const hash = await bcrypt.hash(password, 10); - const avatar = 'https://ui-avatars.com/api/?name=' + encodeURIComponent(username) + '&background=6366f1&color=fff&size=64'; - const role = isFirstUser ? 'admin' : 'user'; - - const r = await pool.query( - `INSERT INTO users (email, password_hash, username, avatar_url, role) - VALUES ($1, $2, $3, $4, $5) - RETURNING id, username, avatar_url, role, created_at`, - [email, hash, username, avatar, role] - ); - - res.json({ - user: r.rows[0], - message: isFirstUser ? '🎉 你是第一个用户,已自动设为管理员!' : '注册成功' - }); - } catch (err) { - if (err.code === '23505') { - res.status(400).json({ error: '邮箱或用户名已被注册' }); - } else { - res.status(500).json({ error: '注册失败,请稍后重试' }); - } - } -}); - -// 登录 -app.post('/api/auth/login', async (req, res) => { - const { email, password } = req.body; - - if (!email || !password) { - return res.status(400).json({ error: '请填写邮箱和密码' }); - } - - try { - const r = await pool.query('SELECT * FROM users WHERE email = $1', [email]); - const user = r.rows[0]; - - if (!user) { - return res.status(401).json({ error: '邮箱或密码错误' }); - } - - const valid = await bcrypt.compare(password, user.password_hash); - if (!valid) { - return res.status(401).json({ error: '邮箱或密码错误' }); - } - - const token = jwt.sign( - { id: user.id, email: user.email, role: user.role }, - JWT_SECRET, - { expiresIn: '7d' } - ); - - res.json({ - token, - user: { - id: user.id, - username: user.username, - avatar_url: user.avatar_url, - bio: user.bio, - role: user.role, - } - }); - } catch (err) { - res.status(500).json({ error: '登录失败,请稍后重试' }); - } -}); - -// 获取当前用户信息 -app.get('/api/auth/me', auth, async (req, res) => { - try { - const r = await pool.query( - 'SELECT id, username, avatar_url, bio, role, created_at FROM users WHERE id = $1', - [req.user.id] - ); - if (!r.rows[0]) { - return res.status(404).json({ error: '用户不存在' }); - } - res.json(r.rows[0]); - } catch (err) { - res.status(500).json({ error: '服务器错误' }); - } -}); - -// ============================================================ -// 用户管理 -// ============================================================ - -// 获取所有用户(管理员) -app.get('/api/users', auth, admin, async (req, res) => { - try { - const r = await pool.query( - 'SELECT id, username, avatar_url, bio, role, created_at FROM users ORDER BY created_at DESC' - ); - res.json(r.rows); - } catch (err) { - res.status(500).json({ error: '服务器错误' }); - } -}); - -// 修改用户角色(管理员) -app.put('/api/users/:id/role', auth, admin, async (req, res) => { - const { role } = req.body; - const userId = req.params.id; - - if (!['user', 'admin'].includes(role)) { - return res.status(400).json({ error: '无效的角色' }); - } - - try { - if (userId === req.user.id) { - return res.status(400).json({ error: '不能修改自己的角色' }); - } - - await pool.query('UPDATE users SET role = $1 WHERE id = $2', [role, userId]); - res.json({ success: true }); - } catch (err) { - res.status(500).json({ error: '服务器错误' }); - } -}); - -// 更新用户资料 -app.put('/api/users/:id', auth, async (req, res) => { - const { username, bio } = req.body; - const userId = req.params.id; - - if (userId !== req.user.id) { - return res.status(403).json({ error: '无权限修改他人资料' }); - } - - try { - await pool.query('UPDATE users SET username = $1, bio = $2 WHERE id = $3', [username, bio || '', userId]); - res.json({ success: true }); - } catch (err) { - if (err.code === '23505') { - res.status(400).json({ error: '用户名已被占用' }); - } else { - res.status(500).json({ error: '服务器错误' }); - } - } -}); - -// ============================================================ -// 帖子接口 -// ============================================================ - -// 获取帖子列表 -app.get('/api/posts', async (req, res) => { - const sort = req.query.sort === 'hot' ? 'updated_at' : 'created_at'; - - try { - const r = await pool.query(` - SELECT - p.*, - u.username, - u.avatar_url, - (SELECT COUNT(*) FROM replies WHERE post_id = p.id) as reply_count - FROM posts p - JOIN users u ON p.user_id = u.id - ORDER BY ${sort} DESC - `); - res.json(r.rows); - } catch (err) { - res.status(500).json({ error: '服务器错误' }); - } -}); - -// 获取单个帖子 -app.get('/api/posts/:id', async (req, res) => { - try { - const r = await pool.query( - `SELECT p.*, u.username, u.avatar_url - FROM posts p - JOIN users u ON p.user_id = u.id - WHERE p.id = $1`, - [req.params.id] - ); - if (r.rows.length === 0) { - return res.status(404).json({ error: '帖子不存在' }); - } - res.json(r.rows[0]); - } catch (err) { - res.status(500).json({ error: '服务器错误' }); - } -}); - -// 创建帖子 -app.post('/api/posts', auth, async (req, res) => { - const { title, content, images } = req.body; - - if (!content || content.trim().length === 0) { - return res.status(400).json({ error: '请填写内容' }); - } - - try { - const r = await pool.query( - `INSERT INTO posts (user_id, title, content, images) - VALUES ($1, $2, $3, $4) - RETURNING *`, - [req.user.id, title || '无标题', content, images || []] - ); - res.json(r.rows[0]); - } catch (err) { - res.status(500).json({ error: '发布失败,请稍后重试' }); - } -}); - -// 删除帖子 -app.delete('/api/posts/:id', auth, async (req, res) => { - try { - const post = await pool.query('SELECT user_id FROM posts WHERE id = $1', [req.params.id]); - if (post.rows.length === 0) { - return res.status(404).json({ error: '帖子不存在' }); - } - - const user = await pool.query('SELECT role FROM users WHERE id = $1', [req.user.id]); - if (post.rows[0].user_id !== req.user.id && user.rows[0]?.role !== 'admin') { - return res.status(403).json({ error: '无权限删除此帖子' }); - } - - await pool.query('DELETE FROM posts WHERE id = $1', [req.params.id]); - res.json({ success: true }); - } catch (err) { - res.status(500).json({ error: '删除失败,请稍后重试' }); - } -}); - -// ============================================================ -// 回复接口 -// ============================================================ - -// 获取帖子回复列表 -app.get('/api/posts/:id/replies', async (req, res) => { - try { - const r = await pool.query( - `SELECT r.*, u.username, u.avatar_url - FROM replies r - JOIN users u ON r.user_id = u.id - WHERE r.post_id = $1 - ORDER BY r.created_at ASC`, - [req.params.id] - ); - res.json(r.rows); - } catch (err) { - res.status(500).json({ error: '服务器错误' }); - } -}); - -// 创建回复 -app.post('/api/posts/:id/replies', auth, async (req, res) => { - const { content } = req.body; - - if (!content || content.trim().length === 0) { - return res.status(400).json({ error: '请填写回复内容' }); - } - - try { - const r = await pool.query( - `INSERT INTO replies (post_id, user_id, content) - VALUES ($1, $2, $3) - RETURNING *`, - [req.params.id, req.user.id, content] - ); - await pool.query('UPDATE posts SET updated_at = NOW() WHERE id = $1', [req.params.id]); - res.json(r.rows[0]); - } catch (err) { - res.status(500).json({ error: '回复失败,请稍后重试' }); - } -}); - -// 删除回复 -app.delete('/api/replies/:id', auth, async (req, res) => { - try { - const reply = await pool.query('SELECT user_id FROM replies WHERE id = $1', [req.params.id]); - if (reply.rows.length === 0) { - return res.status(404).json({ error: '回复不存在' }); - } - - const user = await pool.query('SELECT role FROM users WHERE id = $1', [req.user.id]); - if (reply.rows[0].user_id !== req.user.id && user.rows[0]?.role !== 'admin') { - return res.status(403).json({ error: '无权限删除此回复' }); - } - - await pool.query('DELETE FROM replies WHERE id = $1', [req.params.id]); - res.json({ success: true }); - } catch (err) { - res.status(500).json({ error: '删除失败,请稍后重试' }); - } -}); - -// ============================================================ -// 举报接口 -// ============================================================ - -// 获取举报列表(管理员) -app.get('/api/reports', auth, admin, async (req, res) => { - try { - const r = await pool.query(` - SELECT - r.*, - reporter.username as reporter_name, - handler.username as handler_name, - p.title as post_title, - p.content as post_content - FROM reports r - JOIN users reporter ON r.reporter_id = reporter.id - LEFT JOIN users handler ON r.handler_id = handler.id - LEFT JOIN posts p ON r.post_id = p.id - ORDER BY r.created_at DESC - `); - res.json(r.rows); - } catch (err) { - res.status(500).json({ error: '服务器错误' }); - } -}); - -// 提交举报 -app.post('/api/reports', auth, async (req, res) => { - const { post_id, reason } = req.body; - - if (!post_id || !reason) { - return res.status(400).json({ error: '请填写完整信息' }); - } - - try { - const existing = await pool.query( - 'SELECT id FROM reports WHERE post_id = $1 AND reporter_id = $2 AND status = $3', - [post_id, req.user.id, 'pending'] - ); - if (existing.rows.length > 0) { - return res.status(400).json({ error: '你已经举报过此帖子,请等待处理' }); - } - - await pool.query( - `INSERT INTO reports (post_id, reporter_id, reason) - VALUES ($1, $2, $3)`, - [post_id, req.user.id, reason] - ); - res.json({ success: true }); - } catch (err) { - res.status(500).json({ error: '举报失败,请稍后重试' }); - } -}); - -// 处理举报(管理员) -app.put('/api/reports/:id', auth, admin, async (req, res) => { - const { status, note } = req.body; - - if (!['pending', 'approved', 'rejected'].includes(status)) { - return res.status(400).json({ error: '无效的状态' }); - } - - try { - await pool.query( - `UPDATE reports - SET status = $1, handled_at = NOW(), handler_id = $2, handler_note = $3 - WHERE id = $4`, - [status, req.user.id, note || '', req.params.id] - ); - res.json({ success: true }); - } catch (err) { - res.status(500).json({ error: '操作失败,请稍后重试' }); - } -}); - -// ============================================================ -// 友情链接 -// ============================================================ - -// 获取友情链接 -app.get('/api/links', async (req, res) => { - try { - const r = await pool.query('SELECT * FROM friendly_links ORDER BY sort_order'); - res.json(r.rows); - } catch (err) { - res.status(500).json({ error: '服务器错误' }); - } -}); - -// 添加友情链接(管理员) -app.post('/api/links', auth, admin, async (req, res) => { - const { title, url } = req.body; - - if (!title || !url) { - return res.status(400).json({ error: '请填写完整信息' }); - } - - try { - const r = await pool.query( - `INSERT INTO friendly_links (title, url) - VALUES ($1, $2) - RETURNING *`, - [title, url] - ); - res.json(r.rows[0]); - } catch (err) { - res.status(500).json({ error: '添加失败,请稍后重试' }); - } -}); - -// 删除友情链接(管理员) -app.delete('/api/links/:id', auth, admin, async (req, res) => { - try { - await pool.query('DELETE FROM friendly_links WHERE id = $1', [req.params.id]); - res.json({ success: true }); - } catch (err) { - res.status(500).json({ error: '删除失败,请稍后重试' }); - } -}); - -// ============================================================ -// 统计数据 -// ============================================================ - -app.get('/api/stats', async (req, res) => { - try { - const [postsRes, usersRes] = await Promise.all([ - pool.query('SELECT COUNT(*) FROM posts'), - pool.query('SELECT COUNT(*) FROM users'), - ]); - res.json({ - posts: parseInt(postsRes.rows[0].count) || 0, - users: parseInt(usersRes.rows[0].count) || 0, - topics: parseInt(postsRes.rows[0].count) || 0, - online: Math.floor(Math.random() * 20) + 5, - }); - } catch (err) { - res.status(500).json({ error: '服务器错误' }); - } -}); - -// ============================================================ -// 事件日志 -// ============================================================ - -// 获取事件日志(管理员) -app.get('/api/event-logs', auth, admin, async (req, res) => { - try { - const r = await pool.query( - `SELECT el.*, u.username - FROM event_logs el - LEFT JOIN users u ON el.user_id = u.id - ORDER BY el.created_at DESC - LIMIT 100` - ); - res.json(r.rows); - } catch (err) { - res.status(500).json({ error: '服务器错误' }); - } -}); - -// 记录事件 -app.post('/api/event-logs', auth, async (req, res) => { - const { action } = req.body; - try { - await pool.query( - `INSERT INTO event_logs (user_id, action, ip) - VALUES ($1, $2, $3)`, - [req.user.id, action, req.ip || '0.0.0.0'] - ); - res.json({ success: true }); - } catch (err) { - res.json({ success: true }); - } -}); - -// ============================================================ -// 图片上传 -// ============================================================ - -const storage = multer.diskStorage({ - destination: (req, file, cb) => cb(null, 'uploads/'), - filename: (req, file, cb) => { - const ext = path.extname(file.originalname); - const name = Date.now() + '-' + Math.round(Math.random() * 10000) + ext; - cb(null, name); - } -}); - -const upload = multer({ - storage, - limits: { fileSize: 5 * 1024 * 1024 }, - fileFilter: (req, file, cb) => { - const allowed = ['image/jpeg', 'image/png', 'image/gif', 'image/webp']; - cb(null, allowed.includes(file.mimetype)); - } -}); - -app.post('/api/upload', auth, upload.single('file'), (req, res) => { - if (!req.file) { - return res.status(400).json({ error: '请选择图片' }); - } - res.json({ url: '/uploads/' + req.file.filename }); -}); - -// ============================================================ -// 托管前端文件 -// ============================================================ - -app.use(express.static('.')); - -app.get('*', (req, res) => { - if (!req.path.startsWith('/api')) { - res.sendFile(path.join(__dirname, 'index.html')); - } -}); - -// ============================================================ -// 启动服务器 -// ============================================================ - -app.listen(PORT, '0.0.0.0', () => { - console.log('========================================'); - console.log(' 🌊 Forumlify 已启动'); - console.log(' 📡 http://localhost:' + PORT); - console.log(' 📡 API: http://localhost:' + PORT + '/api'); - console.log('========================================'); -}); From 94cb0f50be99946543409070532d035cc8144d72 Mon Sep 17 00:00:00 2001 From: lezi-fun <177434121+lezi-fun@users.noreply.github.com> Date: Sun, 9 Aug 2026 17:03:00 +0800 Subject: [PATCH 02/10] docs: preserve upstream attribution note in README --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index a6d09af..84e2da6 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,12 @@ docker-compose up -d 应用默认运行在 `http://localhost:3000`(监听 `0.0.0.0`,局域网可访问)。 +--- + +> 以下内容添加自 NodeLoc @Lezi-fun 的 PR(从源码构建与配置说明) + +--- + ### 从源码构建 > 适合二次开发、自定义部署或不想用 Docker 的场景。 From 70a198ae3237006f06f33ed5d648c4e8e089eba5 Mon Sep 17 00:00:00 2001 From: lezi-fun <177434121+lezi-fun@users.noreply.github.com> Date: Sun, 9 Aug 2026 18:12:46 +0800 Subject: [PATCH 03/10] fix: restore original Feather icons across UI - Add components/Icons.js with SVG paths extracted verbatim from the original index.html (14 unique icons) - Restore icons on navbar menu, sidebar, feed actions, post/reply, modals, admin tabs and settings - Replaces emoji placeholders from the initial migration --- app/page.js | 2 +- components/AdminPage.js | 15 ++--- components/Feed.js | 17 ++++-- components/Icons.js | 85 ++++++++++++++++++++++++++ components/Modals.js | 9 +-- components/Navbar.js | 19 ++++-- components/NewPost.js | 3 +- components/PostDetail.js | 5 +- components/ReplyList.js | 11 +++- components/SettingsPage.js | 3 +- components/Sidebar.js | 9 ++- components/admin/AdminForumSettings.js | 3 +- components/admin/AdminLinks.js | 5 +- components/admin/AdminReports.js | 9 ++- 14 files changed, 160 insertions(+), 35 deletions(-) create mode 100644 components/Icons.js diff --git a/app/page.js b/app/page.js index 7da1a31..c1121d8 100644 --- a/app/page.js +++ b/app/page.js @@ -38,7 +38,7 @@ function HomeInner() { {view === 'messages' && (
-

消息

+

消息

暂无消息

diff --git a/components/AdminPage.js b/components/AdminPage.js index 3be3144..c56f3d6 100644 --- a/components/AdminPage.js +++ b/components/AdminPage.js @@ -2,6 +2,7 @@ // 管理后台:5 个 tab import { useState } from 'react'; +import { Icon } from './Icons'; import AdminReports from './admin/AdminReports'; import AdminUsers from './admin/AdminUsers'; import AdminLogs from './admin/AdminLogs'; @@ -9,11 +10,11 @@ import AdminLinks from './admin/AdminLinks'; import AdminForumSettings from './admin/AdminForumSettings'; const TABS = [ - { key: 'reports', label: '举报' }, - { key: 'users', label: '用户' }, - { key: 'logs', label: '日志' }, - { key: 'links', label: '友链' }, - { key: 'settings', label: '论坛设置' }, + { key: 'reports', label: '举报', icon: 'shieldAlert' }, + { key: 'users', label: '用户', icon: 'users' }, + { key: 'logs', label: '日志', icon: 'file' }, + { key: 'links', label: '友链', icon: 'link' }, + { key: 'settings', label: '论坛设置', icon: 'settings' }, ]; export default function AdminPage() { @@ -22,7 +23,7 @@ export default function AdminPage() { return (
-

管理后台

+

管理后台

{TABS.map((t) => ( @@ -31,7 +32,7 @@ export default function AdminPage() { className={'admin-tab' + (tab === t.key ? ' active' : '')} onClick={() => setTab(t.key)} > - {t.label} + {t.label} ))}
diff --git a/components/Feed.js b/components/Feed.js index 5e4e0d0..ffed199 100644 --- a/components/Feed.js +++ b/components/Feed.js @@ -4,6 +4,7 @@ import { useEffect, useState, useCallback } from 'react'; import { API } from '@/lib/api'; import { useApp } from './AppProvider'; +import { Icon } from './Icons'; function avatar(username) { return 'https://ui-avatars.com/api/?name=' + encodeURIComponent(username || '匿名用户') + @@ -12,7 +13,7 @@ function avatar(username) { export default function Feed({ onOpenModal, onReport }) { const { currentUser, sort, setSort, openPost, navigate, refreshKey } = useApp(); - const [posts, setPosts] = useState(null); // null = loading + const [posts, setPosts] = useState(null); const [error, setError] = useState(null); const load = useCallback(async () => { @@ -53,7 +54,7 @@ export default function Feed({ onOpenModal, onReport }) { navigate('new'); }} > - 发布新帖 + 发布新帖
@@ -82,17 +83,23 @@ export default function Feed({ onOpenModal, onReport }) {
)}
- 💬 {p.reply_count || 0} + + {p.reply_count || 0} + + }}> + 举报 + {currentUser && currentUser.id === p.user_id && ( + }}> + 删除 + )}
diff --git a/components/Icons.js b/components/Icons.js new file mode 100644 index 0000000..30ff40b --- /dev/null +++ b/components/Icons.js @@ -0,0 +1,85 @@ +'use client'; + +// 图标库 — SVG 内容逐字符提取自旧版 index.html (Feather Icons),与原版一致 +const S = { + xmlns: 'http://www.w3.org/2000/svg', width: 16, height: 16, viewBox: '0 0 24 24', + fill: 'none', stroke: 'currentColor', strokeWidth: 2, strokeLinecap: 'round', strokeLinejoin: 'round', + style: { display: 'inline', verticalAlign: 'middle' }, +}; + +export function Icon({ name, size = 16, ...rest }) { + return {PATHS[name] || null}; +} + +const PATHS = { + message: ( + <> + + + ), + settings: ( + <> + + + ), + shieldAlert: ( + <> + + + ), + moon: ( + <> + + + ), + logout: ( + <> + + + ), + book: ( + <> + + + ), + link: ( + <> + + + ), + plus: ( + <> + + + ), + shield: ( + <> + + + ), + users: ( + <> + + + ), + file: ( + <> + + + ), + plus2: ( + <> + + + ), + close: ( + <> + + + ), + trash: ( + <> + + + ), +}; diff --git a/components/Modals.js b/components/Modals.js index e909c98..5ae0169 100644 --- a/components/Modals.js +++ b/components/Modals.js @@ -4,6 +4,7 @@ import { useState, useEffect } from 'react'; import { API, generateCaptcha } from '@/lib/api'; import { useApp } from './AppProvider'; +import { Icon } from './Icons'; export default function Modals({ modal, onClose, reportPostId }) { const { login, register, currentUser, refresh } = useApp(); @@ -87,7 +88,7 @@ export default function Modals({ modal, onClose, reportPostId }) { {modal === 'login' && (
- ✕ +

登录

setLoginEmail(e.target.value)} /> setLoginPassword(e.target.value)} @@ -100,7 +101,7 @@ export default function Modals({ modal, onClose, reportPostId }) { {modal === 'register' && (
- ✕ +

注册

setRegUsername(e.target.value)} /> setRegEmail(e.target.value)} /> @@ -119,8 +120,8 @@ export default function Modals({ modal, onClose, reportPostId }) { {modal === 'report' && currentUser && (
- ✕ -

举报帖子

+ +

举报帖子

请选择举报原因:

{post.username || '匿名用户'} {time} {canDelete && ( - + )}
diff --git a/components/ReplyList.js b/components/ReplyList.js index fb65cb0..3e43c87 100644 --- a/components/ReplyList.js +++ b/components/ReplyList.js @@ -4,6 +4,7 @@ import { useEffect, useState, useCallback } from 'react'; import { API, generateCaptcha } from '@/lib/api'; import { useApp } from './AppProvider'; +import { Icon } from './Icons'; function avatar(username) { return 'https://ui-avatars.com/api/?name=' + encodeURIComponent(username || '匿名用户') + @@ -61,7 +62,9 @@ export default function ReplyList({ postId, onRefresh }) { return ( <> -
💬 {replies.length} 条回复
+
+ {replies.length} 条回复 +
{replies.length === 0 ? (
还没有回复,快来抢沙发吧 🛋️
@@ -75,7 +78,9 @@ export default function ReplyList({ postId, onRefresh }) { {r.username || '匿名用户'} {rTime} {currentUser && currentUser.id === r.user_id && ( - + )}
@@ -88,7 +93,7 @@ export default function ReplyList({ postId, onRefresh }) {
-

发表回复

+

发表回复