diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..a38e3d6 --- /dev/null +++ b/.env.example @@ -0,0 +1,23 @@ +# tds-lite-rs 环境变量样例 +# +# 用法:cp .env.example .env 后按需修改;run.sh 会把 .env 里的变量导出给子进程。 +# 🔴 本文件里的每一项都必须是「**生效的**」值 —— 注释掉才是「不生效」。 + +# 后端监听端口(缺省 30010)。 +# 🔴 不许改成 30010 以外的端口:兄弟项目 tdc-rs 已经占了它自己的后端端口, +# 两套服务必须彻底分开(不共享端口 / 数据目录 / 代码)。 +PORT=30010 + +# pglite 数据目录。 +# +# 🔴 **留空** ⇒ 用后端的默认值 `<项目根>/src/backend/data/lite.pg` +# (**绝对路径**,由可执行文件向上定位项目根 ⇒ 与 cwd 无关)。 +# +# 🔴 **不要**在这里写一个**相对**的 PGLITE_DIR:config.rs 对 PGLITE_DIR 是**原样使用** +# (相对路径 ⇒ 相对**当前工作目录**解析)⇒ 换个 cwd 就换一份库,而且**静默**。 +# 真要覆盖,只能写**绝对路径**,例如: +# PGLITE_DIR=/Users/xxx/tds-lite-rs/src/backend/data/lite.pg +# +# 临时库(进程退出即销毁)—— pglite-rs 0.2.7 没有真内存模式, +# `memory://` 走的是 `PGlite::open_temp()`(系统临时目录里的一次性数据目录)。 +# PGLITE_DIR=memory:// diff --git a/.gitignore b/.gitignore index 2a4ab85..be52912 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,7 @@ src/frontend/.vite/ # 运行期 PID / 日志 .run/ +.logs/ *.log # macOS diff --git a/CLAUDE.md b/CLAUDE.md index 3d3449a..2068625 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -37,7 +37,7 @@ v1 = **全量契约对齐**:登录 / `CurrentUser` / 5 组 `base_*` 管理 CRU |---|---|---| | 后端 | Rust 2021 + axum 0.8 + tokio | 单二进制 | | 数据库 | **`pglite-rs` 0.2**(进程内原生 PostgreSQL) | 零服务/零 Docker/零 WASM;数据落盘 `src/backend/data/lite.pg` | -| 前端 | **react 技能的前端产物,逐字复用**(React + Vite) | **零改前端**;vite 代理 `/api` → 后端 | +| 前端 | **react 技能的前端产物,逐字复用**(React + Vite) | **唯一改动 = vite 代理端口 `30000 → 30010`**;vite 代理 `/api` → 后端 | | 密码学 | `aes` 0.8 + `ecb` 0.1 + `md-5` 0.10 | 与 react 技能 `cipher.ts` **逐字节等价** | | 其它 | `serde` / `serde_json` / `serde_urlencoded` 0.7 / `uuid` v4 / `rand` 0.8 | | @@ -45,12 +45,19 @@ v1 = **全量契约对齐**:登录 / `CurrentUser` / 5 组 `base_*` 管理 CRU > 它把 postgres-pglite 编译成原生静态库链进二进制 ⇒ **真实 PostgreSQL 语义**(类型/MVCC/事务/扩展/线协议), > 进程内单 backend。**不是** `@electric-sql/pglite`(那是 WASM + IndexedDB,本仓禁止引入)。 -## 目录速览(目标形态) +## 目录速览(当前形态) ``` tds-lite-rs/ ├── Cargo.toml # 【workspace 根】members = ["src/backend"];release profile 写在这里 ├── CLAUDE.md / HANDOFF.md # 本文件 / 交接文档 +├── README.md # 项目定位 / 启动方式 / 验收门 +├── run.sh # install / build / dev / backend / frontend / stop / logs +├── .env.example # PORT / PGLITE_DIR(后者只能写绝对路径或 memory://) +├── docs/ +│ ├── contract.md # 【契约唯一真源】端点 / 返回形状 / 数据模型 +│ ├── runbook.md # 怎么起 / 怎么冒烟 / 常见故障 +│ └── ddl/ # 官方 DDL 摘录 ├── src/ │ ├── backend/ # Rust 后端(workspace 唯一成员,crate 名 tds-lite-rs) │ │ ├── Cargo.toml @@ -71,12 +78,11 @@ tds-lite-rs/ │ │ │ └── routes.rs # 路由装配 │ │ ├── db/schema.sql # 完整 DDL(base_* 7 张 + 3 业务表) │ │ └── data/ # 运行期数据(gitignore) -│ └── frontend/ # react 技能前端逐字复制(不改) +│ └── frontend/ # react 技能前端逐字复制(**只改** vite.config.ts 的代理端口 30000→30010) ├── scripts/ -│ ├── perm-smoke.sh # 权限闭环冒烟(22+ 断言) -│ └── check-module.sh # 业务模块 9 接触点静态自检 -├── run.sh # install / build / dev / stop / logs -└── .env.example +│ ├── perm-smoke.sh # 权限闭环冒烟(32 条断言,零 node 依赖) +│ └── check-module.sh # 业务模块 9 接触点静态自检(纯静态,不起后端) +└── .gitignore ``` ## 架构红线 @@ -184,8 +190,12 @@ tds-lite-rs/ ## 端点全表 +🔴 `src/backend/src/routes.rs` 里**逐条注册 27 条**路径(axum 0.8.9 用 matchit 0.8.4, +**不支持** `{a,b}` 这种「一段里多个参数」的写法 ⇒ 必须逐条注册)。 + | 方法 | 路径 | 守卫 | 说明 | |---|---|---|---| +| GET | `/api/health` | 无 | **非契约**探活 ⇒ `{ok, tables, version}`;永远有响应(查不到表也返 200) | | POST | `/api/oauth/Login` | 无 | form-urlencoded:`account` / `password`(密文 hex) / `grant_type=password`;成功返回 `{token, expiresIn:7200, tokenTypeName:'bearer'}` | | GET | `/api/oauth/CurrentUser` | 登录 | `{userInfo:{userId,userAccount,userName,isAdministrator}, menuList}`;未登录 `code=600` | | GET/POST/DELETE | `/api/ssw/sys/User/{List,Save,Delete?id=}` | 登录 + 菜单 `system/User` | 列表**去掉 `password`**,附 `roleIds`/`roleNames` | @@ -200,6 +210,7 @@ tds-lite-rs/ | GET/POST/DELETE | `/api/ssw/books/Book/{List,Save,Delete?id=}` | 登录 + 菜单 `books/Book` | | 其它:未知路由 → **HTTP 404** + `{code:404,msg:'接口不存在',data:null}`。 +(`routes.rs` 的「路由表钉子测试」用「错方法 ⇒ 405」逐条证明这 27 条都注册了。) ## 命令速查 @@ -209,13 +220,29 @@ cargo build # debug cargo build --release # 发布版(release profile 写在根 Cargo.toml) cargo test # 单测 +# 工程脚本(仓库根 run.sh;退出码 0 成功 / 1 运行期失败 / 2 用法错) +bash run.sh install # cargo fetch + npm --prefix src/frontend install +bash run.sh build # cargo build --release + vite build +bash run.sh dev # 后台起后端(30010) + 前端(5173),日志 .logs/、PID .run/ +bash run.sh backend # 前台起后端 +bash run.sh frontend # 前台起前端 +bash run.sh stop # 停后台进程(幂等) +bash run.sh logs # tail .logs/{backend,frontend}.log +bash run.sh # 无参 ⇒ 用法错 ⇒ 退出码 2 + # 运行(后端) PORT=30010 ./target/release/tds-lite-rs -PGLITE_DIR=memory:// PORT=30010 ./target/release/tds-lite-rs # 纯内存 +PGLITE_DIR=memory:// PORT=30010 ./target/release/tds-lite-rs # 临时库(系统临时目录的一次性数据目录,进程退出即销毁;pglite-rs 0.2.7 没有真内存模式) -# 冒烟 -bash scripts/perm-smoke.sh # 默认打 127.0.0.1:30010 +# 前端 +npm --prefix src/frontend install # 或 npm ci(严格按 package-lock.json 装) +npm --prefix src/frontend run build # 产出 src/frontend/dist +npm --prefix src/frontend run dev # http://127.0.0.1:5173(vite 代理 /api → 30010) + +# 冒烟 / 自检 +bash scripts/perm-smoke.sh # 默认打 127.0.0.1:30010(32 条断言) B=http://127.0.0.1:30010 bash scripts/perm-smoke.sh +bash scripts/check-module.sh # 9 接触点静态自检(纯静态,不起后端) ./target/release/tds-lite-rs --enc 123456 # cipher 自证(免 node 依赖) ``` @@ -227,16 +254,16 @@ B=http://127.0.0.1:30010 bash scripts/perm-smoke.sh | 症状 | 根因 | 处理 | |---|---|---| -| 登录必失败(400 账号或密码错误) | cipher key 当成了 16 字节原始摘要 ⇒ AES-128 | key = md5_hex 的 **32 个 ASCII 字节** ⇒ AES-256 | -| `f_price` 回显 `9.9` 而不是 `"9.90"` | `row_to_json` 把 numeric 给了数字 | 投影里 `f_price::text AS price` | -| 角色授权写了不生效 | 写进 `base_role_relation.f_user_id`(**不存在此列**) | 用户 id 写 `f_object_id` + `f_object_type='user'` | -| 组织/岗位授权不生效 | 写进 `base_role_relation` | 写 `base_user_relation`(有 `f_user_id`) | -| 授权接口返 200 但一行没写 | `objectType` 传了 `'Role'`(大写) | 必须小写 `'role'`;`module` 传一维数组 | -| 非管理员拿到了全部菜单 | 只查了角色授权 | 四源合并(直授+角色+组织+岗位) | -| 菜单授权没生效但接口放行 | 菜单 `f_url_address` ≠ 前端 Route path | 三处(urlAddress / Route path / 守卫 key)必须一字不差 | -| `Option>` 编译不过 | axum 0.8.9 的 `Form` 无 `OptionalFromRequest` | 取原始 body 自己 `serde_urlencoded` 解析 | -| 405 返回 HTML / 丢 `Allow` 头 | 用了 axum 的 `method_not_allowed_fallback` | 用响应改写中间件(链尾) | -| DDL 能从 HTTP 下载 | DDL 落在 web root | 移到 `db/` + 兜底守卫 | +| 登录必失败(400 账号或密码错误) | cipher key 当成了 16 字节原始摘要 ⇒ AES-128 | key = md5_hex 的 **32 个 ASCII 字节** ⇒ AES-256 ✅**本仓已修**(`cipher.rs` 按此实现,上游检验向量单测钉死) | +| `f_price` 回显 `9.9` 而不是 `"9.90"` | `row_to_json` 把 numeric 给了数字 | 投影里 `f_price::text AS price` ✅**本仓已修**(冒烟断言比的是**原始 JSON 文本**,字符串与数字能分出来) | +| 角色授权写了不生效 | 写进 `base_role_relation.f_user_id`(**不存在此列**) | 用户 id 写 `f_object_id` + `f_object_type='user'` ✅**本仓已修** | +| 组织/岗位授权不生效 | 写进 `base_role_relation` | 写 `base_user_relation`(有 `f_user_id`) ✅**本仓已修** | +| 授权接口返 200 但一行没写 | `objectType` 传了 `'Role'`(大写) | 必须小写 `'role'`;`module` 传一维数组 ✅**本仓已修**(冒烟断言覆盖一维/二维两种写法) | +| 非管理员拿到了全部菜单 | 只查了角色授权 | 四源合并(直授+角色+组织+岗位) ✅**本仓已修**(冒烟断言「菜单已按授权收窄」+「访问 User/List ⇒ 403」) | +| 菜单授权没生效但接口放行 | 菜单 `f_url_address` ≠ 前端 Route path | 三处(urlAddress / Route path / 守卫 key)必须一字不差 ✅**本仓已修**(`scripts/check-module.sh` 的第 9 条接触点逐模块钉住) | +| `Option>` 编译不过 | axum 0.8.9 的 `Form` 无 `OptionalFromRequest` | 取原始 body 自己 `serde_urlencoded` 解析 ✅**本仓已修**(登录端点即此写法) | +| 405 返回 HTML / 丢 `Allow` 头 | 用了 axum 的 `method_not_allowed_fallback` | 用响应改写中间件(链尾) ✅**本仓已修**(`routes.rs` 测试断言 405 + 保留 `Allow` 头) | +| DDL 能从 HTTP 下载 | DDL 落在 web root | 移到 `db/` + 兜底守卫 ✅**本仓已修**(测试断言两条 DDL 路径都返 404) | | 第二个实例起不来 | pglite 单实例独占数据目录 | 换数据目录/端口 | | 集成测试互相撞车 | pglite 独占 + 种子账号唯一 | 串行跑 或 各用独立数据目录 | | 账号能建重复 | 官方 `f_account` **无 UNIQUE**(故意的) | 唯一性**应用层**保证;只比 `delete_mark=0` 的行 | diff --git a/HANDOFF.md b/HANDOFF.md index 5a721e0..59fc325 100644 --- a/HANDOFF.md +++ b/HANDOFF.md @@ -7,17 +7,22 @@ ## 0. 当前状态 +**v1 已完成,验收四门全绿**(每一条 ✅ 都有实际执行输出,见 §9 与各任务报告)。 + | 项 | 状态 | |---|---| -| 目录 `~/Desktop/workspace/tds-lite-rs/` | ✅ 已建(`git init` 已做,**未 commit**) | -| `CLAUDE.md` | ✅ 已写(项目级 agent 指引:红线 / 坑位 / 端点全表 / 数据模型) | -| `HANDOFF.md`(本文件) | ✅ 已写 | -| 代码 | ⬜ **零行**。`src/` `scripts/` `Cargo.toml` `schema.sql` 都还没有 | -| 前端 | ⬜ 还没复制(`ssw-jnpf-lite-react/src/frontend` → 本仓 `src/frontend`) | -| 设计 | ✅ 已定稿(见 §3),**不要再重新设计** | +| 目录 `~/Desktop/workspace/tdc-lite-rs/` | ✅ 已建并已 commit(`main` 分支) | +| `CLAUDE.md` | ✅ 已写;**已逐条核对并与代码同步**(Task 12) | +| `HANDOFF.md`(本文件) | ✅ 已写并已同步(§0 状态表 / §9 交接话术,Task 12) | +| 代码 | ✅ 后端已实现(`src/backend/`,Rust 2021 + axum 0.8 + pglite-rs 0.2,**10 张表**、**27 条路由**) | +| 前端 | ✅ 已逐字复制(`src/frontend/`;**唯一改动 = vite 代理端口 `30000 → 30010`**,其余文件逐字节相同) | +| 脚本 | ✅ `scripts/perm-smoke.sh`(**32 条断言**)+ `scripts/check-module.sh`(9 接触点静态自检,**55 条 ✅**) | +| 工程脚本 | ✅ `run.sh`(`install`/`build`/`dev`/`backend`/`frontend`/`stop`/`logs`,退出码 0/1/2) | +| 文档 | ✅ `README.md` / `docs/runbook.md` / `.env.example` | +| 验收四门 | ✅ 全绿(编译 **0 error 0 warning** · 单测 **177 passed / 0 failed** · 冒烟 **PASS=32 FAIL=0** · 前端**浏览器**手验全过) | -**开工前先读**:`CLAUDE.md`(红线与坑位)→ 本文件 §3(设计)→ §5(实施顺序)。 -§4 的四道验收门是"什么算做完"的唯一判据。 +**读法**:`CLAUDE.md`(红线与坑位,日常改代码必读)→ §9(怎么起 / 怎么复现验收)。 +§3(设计)与 §5(实施顺序 step 0–12)已**完结**,留作背景与决策记录,**不要再照着实施一遍**。 --- @@ -352,9 +357,79 @@ tds-lite-rs/ ← 独立 git 仓(已 init,未 commit) --- -## 9. 会话交接话术(给下一个会话的提示词) +## 9. 交接话术(交付态:这个仓是什么、怎么跑、怎么复现验收) -> 读 `CLAUDE.md` + `HANDOFF.md`(本文件)。设计已定稿,**不要重新设计**。 -> 从 **step 0** 开始按 §5 顺序实施,每步先跑该步的完成判据。 -> 参照物:`ssw-jnpf-lite-react`(契约真源,只读)、`jnpf/jnpf-database/PostgreSQL/JNPF-PostgreSQL.sql`(数据模型真源,只读)、 -> `tdc-rs`(工程手法参考,只读,**不改**)。四道验收门见 §4,全部绿了才算完成。 +> 读 `CLAUDE.md` + `HANDOFF.md`(本文件)。**设计已定稿且已实现完毕,不要重新设计、不要重写。** + +### 一句话 + +`tds-lite-rs` = **JNPF 兼容契约的 Rust 实现**(单二进制、零外部服务:Rust 2021 + axum 0.8 + +pglite-rs 0.2 进程内原生 PostgreSQL;10 张表、27 条路由)。 +**状态:v1 已完成,四道验收门全绿**(见 §0)。 + +### 怎么起 + +```bash +cd ~/Desktop/workspace/tdc-lite-rs +bash run.sh install # 一次性:cargo fetch + npm --prefix src/frontend install +bash run.sh build # 一次性:cargo build --release + vite build +bash run.sh dev # 日常:后台起后端(30010) + 前端(5173) +``` + +- 前端:**http://127.0.0.1:5173**(vite dev server,`/api` 代理到后端) +- 后端:**http://127.0.0.1:30010** +- 账号:**`admin` / `123456`**(首次启动自动种子) +- `bash run.sh logs` 看日志(`.logs/backend.log`、`.logs/frontend.log`);`bash run.sh stop` 停(幂等) +- 🔴 `run.sh` 的 `kill_ports` 是 `kill -9` ⇒ 只清 **30010 / 5173**,**绝不碰兄弟项目 `tdc-rs` 的端口** +- 🔴 打 localhost 用 curl **必须**加 `--noproxy '*'`(本机 curl 走系统代理) + +### 怎么复现验收(四门,逐字命令 + 通过标准) + +| 门 | 命令 | 通过标准 | +|---|---|---| +| ① 编译 | `cargo build --release` | **0 error 0 warning** | +| ② 单测 | `cargo test` | **177 passed / 0 failed**(8 个测试目标:63+6+19+24+3+18+7+37) | +| ③ 冒烟 | `bash scripts/perm-smoke.sh`(后端先起在 `:30010`) | **PASS=32 FAIL=0**,退出码 0 | +| ④ 前端手验 | `bash run.sh dev` ⇒ 浏览器开 `http://127.0.0.1:5173` | `admin/123456` 登录 → 菜单树正确 → 5 个管理页可增删改 → 3 个业务页可用 → 退出再登录 | + +外加前置闸门:`bash scripts/check-module.sh`(9 接触点静态自检,纯静态、零 node 依赖; +期望 `PASS=55 FAIL=0`;无参 ⇒ 查全部三个业务模块)。 + +> 门④ 的浏览器手验清单(逐条): +> 1. `admin/123456` 登录 ⇒ Dashboard 出现「功能菜单」; +> 2. 菜单树 = 系统管理(用户管理 / 角色管理 / 机构管理 / 菜单管理)+ Demo 示例 + 产品管理 + 图书超市; +> 3. 4 个管理页(用户/角色/机构/菜单)从菜单按钮进入,页面标题正确,且**可增删改**; +> 4. 3 个业务页(DemoItem / Product / Book)可达、可增删; +> 5. 退出 ⇒ 回登录页 ⇒ 再登录 ⇒ 仍正常。 +> +> ⚠️ 已知:**react 版 Dashboard 只渲染「目录的子项」**(`node.children`)⇒ +> Demo 示例 / 产品管理 / 图书超市是**顶层页面型菜单**(`parentId='0'`,无子项)⇒ +> **Dashboard 里没有按钮**,只能按 URL 直达(`/demo-item`、`/shop/Product`、`/books/Book`)。 +> 这是**参照物原样行为**(前端逐字复制 ⇒ 本仓未改),**不是本仓的 bug**。 + +### 已知限制(分支级) + +摘自 ledger(`.superpowers/sdd/tds-lite-rs-v1/progress.md`)的「分支级已知限制清单」: + +- **(k)** release 二进制**没有** catch-all 的自动化覆盖(触发 panic 的端点是 `#[cfg(test)]` 专属; + catch-all 中间件代码在测试构建与 release 构建里**逐字相同**,且 release profile **无** `panic = "abort"` ⇒ 行为等价)。 +- **(l)** `Path` 遇**畸形百分号编码** ⇒ axum 默认返**纯文本 400(非信封)**(handler 签名由契约 §S17 定死,改它要动 `sys.rs`)。 +- **(m)** 冒烟脚本**每次跑**会往库里留一行 `shop_product` + 一行 `book_shop_book` + 一行 `smoke_user` + (react 同款行为;契约 §13 未要求清理 ⇒ 不改)。 +- **(n)** 冒烟脚本在「重复账号 curl 超时」场景下 stderr 会多一行 `cat: … No such file`(观感,判据不受影响)。 +- **(o)** 冒烟脚本在「空 body 前置失败」时 jq / python 两条路径的**前置提示文案**不同 + (`code=无` vs `code=ERR`),退出码都是 2。 + +本任务(Task 12)另记两条**已观察、未改**的观察(留给最终整体评审裁决): + +- **react 版 Dashboard 只渲染「目录的子项」** ⇒ 3 个顶层业务页在菜单里**没有入口按钮**(只能按 URL 直达)。 + 前端是**逐字复制** ⇒ 改它会破「除代理端口外一字不改」的硬约束 ⇒ **不改**,只记档。 +- `src/frontend/vite.config.ts` 的注释仍写着「转发到 **NestJS** 后端(30010)」—— + 本仓后端是 **Rust**。该注释行属于「代理目标行 + 紧邻注释行」两行允许改动范围, + 但 brief 只授权把端口 `30000 → 30010` ⇒ 框架名**逐字保留**,**不「顺手修好」**(最终评审按 Minor 记)。 + +### 下一步(按 plan) + +验收四门全绿 ⇒ **下一步是把本仓 1:1 复制成技能 `ssw-jnpf-lite-rust`**, +落在 `~/Desktop/workspace/skills/`,与 `ssw-jnpf-lite-react` 并列 +(技能资产形态 = 本仓 1:1 复制;目录结构已刻意与 react 版对齐)。 diff --git a/README.md b/README.md new file mode 100644 index 0000000..21b0aa3 --- /dev/null +++ b/README.md @@ -0,0 +1,113 @@ +# tds-lite-rs + +**JNPF 兼容契约的 Rust 实现** —— 单二进制、零外部服务(进程内原生 PostgreSQL)。 + +它的存在意义只有一条:**让「用 Rust 写业务」和「迁回官方 JNPF(Java)」之间是机械翻译,而不是重写。** +为此本仓的**数据模型(`base_*` 表名/列名/语义)与 HTTP 契约**从第一天起就锁死成官方 JNPF 的形状。 + +- 📘 **契约唯一真源**:[`docs/contract.md`](docs/contract.md) —— 与本文件冲突时以契约为准。 +- 🧭 **agent 指引**:[`CLAUDE.md`](CLAUDE.md)(红线 / 踩坑 / 端点全表)· [`HANDOFF.md`](HANDOFF.md)(交接)。 +- 🛠 **怎么起 / 怎么冒烟 / 常见故障**:[`docs/runbook.md`](docs/runbook.md)。 + +--- + +## 快速开始 + +```bash +# 一次性:装依赖(cargo fetch + npm install)+ 构建(cargo build --release + vite build) +bash run.sh install +bash run.sh build + +# 日常:后台起后端(30010) + 前端(5173),日志在 .logs/,PID 在 .run/ +bash run.sh dev +# 前端 http://127.0.0.1:5173 后端 http://127.0.0.1:30010 +# 账号 admin / 123456 + +bash run.sh stop # 停(幂等) +bash run.sh logs # 看日志尾部 +``` + +| 端口 | 谁 | 说明 | +|---|---|---| +| `30010` | 后端(Rust) | `PORT` 可覆盖;**兄弟项目 `tdc-rs` 占了 `:30000`,本仓不碰** | +| `5173` | 前端(vite dev) | `strictPort: true` ⇒ 端口被占直接报错,不自动换端口 | + +--- + +## 目录 + +``` +tds-lite-rs/ +├── Cargo.toml # cargo workspace 根(成员 = src/backend)+ release profile +├── run.sh # install / build / dev / backend / frontend / stop / logs +├── .env.example # PORT / PGLITE_DIR(PGLITE_DIR 只能写绝对路径或 memory://) +├── src/backend/ # Rust 后端(axum 0.8 + pglite-rs 0.2,10 张表,27 条路由) +├── src/frontend/ # react 技能前端**逐字复制**(只改 vite 代理端口 30000 → 30010) +├── scripts/perm-smoke.sh # 权限闭环冒烟(32 条断言,零 node 依赖) +├── scripts/check-module.sh # 业务模块 9 接触点静态自检(纯静态,不起后端) +└── docs/ # contract.md(契约)· runbook.md(运维)· ddl/ +``` + +--- + +## 它做了什么(v1 = 全量契约对齐) + +- **登录 / `CurrentUser`**:`POST /api/oauth/Login`(form-urlencoded,密文 hex)⇒ `{token, expiresIn:7200, tokenTypeName:'bearer'}`; + `GET /api/oauth/CurrentUser` ⇒ `{userInfo, menuList}`。 +- **5 组 `base_*` 管理 CRUD**:用户 / 角色 / 机构 / 菜单 / 授权。 +- **统一授权**:`PUT /api/permission/Authority/Data/{objectId}`(body `{objectType:'role', module:[...]}`,**小写 + 一维数组**)。 +- **四源权限合并**:用户直授 + 角色 + 组织 + 岗位;**管理员在任何 SQL 之前短路放行**;**菜单未映射 ⇒ 放行**。 +- **两段式种子**:`ensure_base`(每次启动补内置角色/菜单/授权)+ `first_seed`(仅首次建 `admin/123456`)。 +- **3 个业务模块**(spec 驱动 CRUD 引擎):`demo/DemoItem` · `shop/Product` · `books/Book`。 + +### 契约红线(摘要,完整版见 `CLAUDE.md`) + +1. **业务失败一律 HTTP 200 + `{code,msg,data}`**;成败只看 body 的 `code`。 + 唯一例外:**未知路由 = HTTP 404**(body 仍是信封)。鉴权失败也是 200(`600` 未登录 / `403` 无菜单权限)。 +2. **`base_*` 表名/列名逐字对齐官方 JNPF DDL**(含两个「故意不修正」的陷阱,见 `CLAUDE.md`)。 +3. **numeric 列必须是 JSON 字符串**(`"9.90"`,不是 `9.9`);int 列保持数字。 +4. **口令不得外泄**:库里存 `md5(明文)`,对外响应手工挑字段(用户列表去掉 `password`)。 +5. **schema DDL 绝不可从 HTTP 下载**。 + +--- + +## 验收门 + +| 门 | 命令 | 通过标准 | +|---|---|---| +| ① 编译 | `cargo build --release` | 0 error **0 warning** | +| ② 单测 | `cargo test` | 全绿(当前 **177 passed / 0 failed**) | +| ③ 冒烟 | `bash scripts/perm-smoke.sh` | **PASS=32 FAIL=0**(需后端已起在 `:30010`) | +| ④ 前端手验 | `bash run.sh frontend` | `http://127.0.0.1:5173` → `admin/123456` 登录 → 菜单树正确 → 5 个管理页可增删改 → DemoItem/Product/Book 三页可用 → 退出再登录 | + +外加:`bash scripts/check-module.sh`(9 接触点静态自检)—— 加业务模块后立刻跑的前置闸门。 + +> 本机 curl 走系统代理 ⇒ 打 localhost **必须**加 `--noproxy '*'`。 + +--- + +## 三个参照物(各司其职,别混) + +| 参照物 | 地位 | +|---|---| +| 官方 JNPF 源码 + DDL(`~/Desktop/workspace/jnpf/`) | **数据模型真源**(`base_*` 表名/列名) | +| `ssw-jnpf-lite-react` 技能(`~/Desktop/workspace/skills/ssw-jnpf-lite-react/`) | **行为真源**(NestJS 版把契约跑起来了);本仓前端是它的**逐字复制** | +| `tdc-rs` 兄弟项目(`~/Desktop/workspace/tdc-rs/`) | **只抄工程手法**;不共享代码 / 端口 / 数据目录 | + +--- + +## 已知限制(分支级) + +- **release 二进制没有 catch-all 的自动化覆盖**:触发 panic 的端点是 `#[cfg(test)]` 专属; + catch-all 中间件代码在测试构建与 release 构建里逐字相同,且 release profile **无** `panic = "abort"` ⇒ 行为等价。 +- **`Path` 遇畸形百分号编码** ⇒ axum 默认返纯文本 400(**非信封**);handler 签名由契约定死。 +- **冒烟脚本每次跑会往库里留一行** `shop_product` + 一行 `book_shop_book` + 一行 `smoke_user`(react 同款行为,契约未要求清理)。 +- 冒烟脚本在「重复账号 curl 超时」场景下 stderr 会多一行 `cat: … No such file`(观感,判据不受影响)。 +- 冒烟脚本在「空 body 前置失败」时 jq / python 两条路径的前置提示文案不同(退出码都是 2)。 + +--- + +## 技术栈 + +Rust 2021 · axum 0.8 · tokio · pglite-rs 0.2(进程内原生 PostgreSQL,零服务/零 Docker/零 WASM)· +aes 0.8 + ecb 0.1 + md-5 0.10 · React 18 + Vite 5(逐字复用) diff --git a/docs/runbook.md b/docs/runbook.md new file mode 100644 index 0000000..dba3507 --- /dev/null +++ b/docs/runbook.md @@ -0,0 +1,195 @@ +# runbook —— tds-lite-rs 怎么起、怎么冒烟、坏了怎么办 + +> 契约见 [`contract.md`](contract.md);红线与坑位清单见 [`../CLAUDE.md`](../CLAUDE.md)。 + +--- + +## 0. 前置 + +| 工具 | 版本(本机实测) | 用途 | +|---|---|---| +| Rust | ≥ 1.85(edition 2021;本机实测 rustc 1.95.0) | 后端 | +| Node / npm | node v26.8.1 · npm 11.19.0 | 前端(vite 5) | +| jq | 1.7.1(`/usr/bin/jq`) | 冒烟脚本的 JSON 取值(无则 python3 兜底) | +| python3 | 3.14.5 | 冒烟脚本的 JSON 取值兜底 | + +🔴 **后端与 `scripts/perm-smoke.sh` 零 node 依赖** —— 冒烟脚本用后端自己的 `--enc` 子命令自证 cipher。 +前端用 npm/vite 是它本来的工具链,允许。 + +--- + +## 1. 第一次上手 + +```bash +cd ~/Desktop/workspace/tdc-lite-rs + +bash run.sh install # cargo fetch + npm --prefix src/frontend install +bash run.sh build # cargo build --release + vite build(产出 src/frontend/dist) +``` + +`install` 用的是 `npm install`(**可能更新 `package-lock.json`**)。想严格按 lock 装、不碰 lock,用: + +```bash +npm --prefix src/frontend ci +``` + +> ⚠️ 本机 npm 11 会打印 `install-scripts 2 packages have install scripts not yet covered by allowScripts` +> (`esbuild` / `fsevents`)。**不影响构建** —— vite 用的二进制来自平台包 `@esbuild/darwin-*`。 +> 万一 vite 报「esbuild binary not found」,再执行: +> `npm --prefix src/frontend install-scripts approve esbuild && npm --prefix src/frontend install`。 + +--- + +## 2. 日常启动 + +```bash +bash run.sh dev # 后台起后端(30010) + 前端(5173) +bash run.sh logs # 看 .logs/backend.log + .logs/frontend.log 尾部 +bash run.sh stop # 停(幂等:无进程时也不报错,退出码 0) +``` + +- 前端:**http://127.0.0.1:5173** +- 后端:**http://127.0.0.1:30010** +- 账号:**`admin` / `123456`**(首次启动自动种;密码用浏览器侧 `utils/cipher.ts` 加密后提交) +- PID 在 `.run/{backend,frontend}.pid`,日志在 `.logs/{backend,frontend}.log`(两者都在 `.gitignore` 里) + +单起一半: + +```bash +bash run.sh backend # 前台跑后端(Ctrl-C 停) +bash run.sh frontend # 前台跑 vite +``` + +`run.sh` 退出码:**0** 成功 / **1** 运行期失败 / **2** 用法错(无参、未知子命令)。 +`bash run.sh --help` 打印用法并退出 **0**。 + +🔴 **`run.sh` 的 `kill_ports` 是 `kill -9`** ⇒ 它只会清 **30010** 和 **5173** 两个端口。 +**兄弟项目 `tdc-rs` 的端口不在列表里**(打死它就是破坏兄弟项目)。 + +--- + +## 3. 环境变量(`.env`) + +`run.sh` 会把仓库根的 `.env` 导出给子进程(`set -a; . .env; set +a`)。样例见 `.env.example`。 + +| 变量 | 默认 | 说明 | +|---|---|---| +| `PORT` | `30010` | 后端监听端口 | +| `PGLITE_DIR` | `<项目根>/src/backend/data/lite.pg` | 数据目录(**绝对路径**,与 cwd 无关) | + +🔴 **`PGLITE_DIR` 只能写绝对路径**。`config.rs` 对它是**原样使用** ⇒ 相对路径会相对**当前工作目录**解析 +⇒ 换个 cwd 就换一份库,而且**静默**。要临时库就写 `PGLITE_DIR=memory://` +(pglite-rs 0.2.7 没有真内存模式,走的是系统临时目录里的一次性数据目录,进程退出即销毁)。 + +--- + +## 4. 冒烟与自检 + +### 4.1 权限闭环冒烟(32 条断言) + +```bash +bash run.sh dev # 后端得先起来 +bash scripts/perm-smoke.sh # 期望:PASS=32 FAIL=0,退出码 0 +B=http://127.0.0.1:30010 bash scripts/perm-smoke.sh # 打别的地址 +JQ_BIN="" bash scripts/perm-smoke.sh # 强制走 python3 兜底路径(两条路径判据一致) +``` + +退出码:**0** 全绿 / **1** 有断言失败 / **2** 前置错误(后端不可达、缺 jq+python3、缺 `--enc` 二进制)。 + +断言覆盖:未登录 `600` → 加密登录 → 菜单树分组 → 建用户 → 重复账号 `400`(不是 500)→ +一维/二维授权写入 → 非管理员菜单收窄 → `403` → 未知路由 `404` → 管理员短路 → +Product/Book 往返(36 位 UUID、numeric 是 JSON 字符串 `"9.90"`、int 是 JSON 数字 `100`)。 + +### 4.2 业务模块 9 接触点静态自检 + +```bash +bash scripts/check-module.sh # 无参 ⇒ 检查全部三个业务模块 +bash scripts/check-module.sh books Book # 只查一个 +``` + +**纯静态**:不启动后端、不发请求、不依赖 node。 +每个 `appCode/Entity` 查 9 个接触点(后端路由注册 · spec 定义 · 实体表 · 守卫 `module_key` · +前端 api 文件 · 前端页面 · 前端路由 · 菜单种子 · **授权 key 三处一字不差**), +外加两条契约红线(`f_` 前缀 + `f_id VARCHAR(50)` 主键 · 软删契约)。 + +退出码:**0** 全过 / **1** 有 ❌ / **2** 用法错(未知参数、app_code/Entity 不在本仓已知清单)。 + +> 🔴 demo 模块**没有** `api/demoitem.ts`(`views/DemoItem.tsx` 直接 `request.get('/ssw/demo/DemoItem/List')`) +> ⇒ 这一条走「view 直连」分支;两种都查不到才算 ❌。 + +--- + +## 5. 前端手验清单(验收门④) + +```bash +bash run.sh dev +``` + +浏览器打开 **http://127.0.0.1:5173**: + +1. `admin` / `123456` 登录 ⇒ 进 Dashboard; +2. 菜单树正确:系统管理(用户管理 / 角色管理 / 机构管理 / 菜单管理)+ Demo 示例 + 产品管理 + 图书超市; +3. 5 个管理页可增删改(用户 / 角色 / 机构 / 菜单 / 授权); +4. 3 个业务页可用(DemoItem / Product / Book); +5. 退出再登录 ⇒ 仍正常。 + +**代理自检**(不开浏览器也能验): + +```bash +curl --noproxy '*' -s http://127.0.0.1:5173/ | grep '
' +curl --noproxy '*' -s http://127.0.0.1:5173/api/health +# => {"ok":true,"tables":10,"version":"0.1.0"} ← 说明 vite 代理把 /api 转到了 30010 +``` + +--- + +## 6. 常见故障 + +### 6.1 本机特有 + +| 症状 | 根因 | 处理 | +|---|---|---| +| `curl http://127.0.0.1:5173` 连不上 / 502 | 本机 curl 走**系统代理** | 加 `--noproxy '*'` | +| `localhost:5173` 连不上 | macOS 上 vite 默认只 bind `::1` | 用 `127.0.0.1:5173`(`vite.config.ts` 已强制 IPv4) | +| 起后台进程后工具一返回就没了 | `nohup … &` 会被回收 | 用 Bash 工具的 `run_in_background`;stdout **不要**指向 `/dev/null`(进程会以 100 退出) | +| vite 报端口被占 | `strictPort: true`(故意不自动换端口) | `lsof -ti:5173` 看清是谁;或 `bash run.sh stop` | +| `npm install` 卡在 esbuild | npm 11 的 `allowScripts` 闸门 | `npm --prefix src/frontend install-scripts approve esbuild && npm --prefix src/frontend install` | +| 第二个后端实例起不来 | **pglite 单实例独占数据目录** | 换 `PGLITE_DIR` 或换端口 | + +### 6.2 契约层(与 `CLAUDE.md` 的踩坑清单一一对应) + +| 症状 | 根因 | 处理 | +|---|---|---| +| 登录必失败(400 账号或密码错误) | cipher key 当成 16 字节原始摘要 ⇒ AES-128 | key = `md5_hex` 的 **32 个 ASCII 字节** ⇒ AES-256 | +| `f_price` 回显 `9.9` 而不是 `"9.90"` | `row_to_json` 把 numeric 给了数字 | 投影里 `f_price::text AS price` | +| 角色授权写了不生效 | 写进 `base_role_relation.f_user_id`(**不存在此列**) | 用户 id 写 `f_object_id` + `f_object_type='user'` | +| 组织/岗位授权不生效 | 写进 `base_role_relation` | 写 `base_user_relation`(那里才有 `f_user_id`) | +| 授权接口返 200 但一行没写 | `objectType` 传了 `'Role'`(大写) | 必须小写 `'role'`;`module` 传一维数组 | +| 非管理员拿到了全部菜单 | 只查了角色授权 | 四源合并(直授+角色+组织+岗位) | +| 菜单授权没生效但接口放行 | 菜单 `f_url_address` ≠ 前端 Route path | 三处(urlAddress / Route path / 守卫 key)必须一字不差 | +| 405 返回 HTML / 丢 `Allow` 头 | 用了 axum 的 `method_not_allowed_fallback` | 用响应改写中间件(链尾) | +| DDL 能从 HTTP 下载 | DDL 落在 web root | 移到 `db/` + 兜底守卫 | + +--- + +## 7. 数据重置 + +库是**嵌入式 pglite 数据目录**(默认 `src/backend/data/lite.pg`),**没有独立的 PG 服务**。 + +```bash +bash run.sh stop +mv src/backend/data src/backend/data.bak-$(date +%s) # 改名备份(可恢复),下次启动重建空库 +bash run.sh dev # 空库 ⇒ 重新种子(admin/123456) +``` + +🔴 **schema 只在首次建表时执行** ⇒ 改了 `src/backend/db/schema.sql` 之后**必须**走这一步,否则改动不生效。 + +--- + +## 8. 边界(别越界) + +- `tdc-rs` 兄弟项目:**不共享**代码 / 端口 / 数据目录。`run.sh` 的 `kill_ports` 只清 30010 与 5173。 +- `~/Desktop/workspace/skills/ssw-jnpf-lite-react/`(参照物):**只读**。本仓 `src/frontend/` 是它的逐字复制, + 唯一改动是 `vite.config.ts` 的代理端口 `30000 → 30010`(连注释行一起改;`src/api/request.ts` 的 + 注释与 axios 的 `timeout: 30000` **刻意逐字节不动**)。 +- `src/backend/**`、`docs/contract.md`、`scripts/perm-smoke.sh`:**已定稿**,改动需走评审。 diff --git a/run.sh b/run.sh new file mode 100755 index 0000000..cd766fb --- /dev/null +++ b/run.sh @@ -0,0 +1,172 @@ +#!/usr/bin/env bash +# tds-lite-rs 一键脚本 +# +# 后端 = Rust 单二进制(cargo workspace 根 = 仓库根 ⇒ target/ 在仓库根)。 +# 数据库为嵌入式 pglite-rs(进程内原生 PostgreSQL),零服务 / 零 Docker / 零 WASM。 +# +# 用法: +# ./run.sh install 安装依赖(cargo fetch + npm install) +# ./run.sh build 构建(cargo build --release + vite build) +# ./run.sh dev 后台起后端(30010) + 前端(5173),日志进 .logs/,PID 写入 .run/ +# ./run.sh backend 前台起后端 +# ./run.sh frontend 前台起前端 +# ./run.sh stop 用 PID 文件停后台进程 + 兜底 kill_ports +# ./run.sh logs tail .logs/{backend,frontend}.log +# ./run.sh --help 本用法 +# +# 退出码:0 成功 / 1 运行期失败 / 2 用法错 +set -euo pipefail + +ROOT="$(cd "$(dirname "$0")" && pwd)" +LOGS="$ROOT/.logs" +RUN="$ROOT/.run" + +# 后端端口:兄弟项目 tdc-rs 已占用它自己的后端端口,本仓一律用 30010。 +# 前端 vite 端口固定 5173(vite.config.ts 里 strictPort: true)。 +BACKEND_PORT=30010 +FRONTEND_PORT=5173 + +# 🔴 kill_ports 用的是 kill -9 ⇒ 端口列表**只能是本仓自己的这两个端口**。 +# 不许把兄弟项目 tdc-rs 的端口写进来(打死它就是破坏兄弟项目)。 +BACKEND_BIN="$ROOT/target/release/tds-lite-rs" + +mkdir -p "$LOGS" "$RUN" + +# 加载项目根 .env(后端不 import dotenv,靠这里把 PORT / PGLITE_DIR 导出给子进程) +if [ -f "$ROOT/.env" ]; then + set -a; . "$ROOT/.env"; set +a +fi + +export PORT="${PORT:-30010}" + +usage() { + cat <<'EOF' +用法: ./run.sh <子命令> + install 安装依赖(cargo fetch + npm install) + build 构建(cargo build --release + vite build) + dev 后台起后端(30010) + 前端(5173) + backend 前台起后端 + frontend 前台起前端 + stop 停止后台进程 + logs 打印后端/前端日志尾部 + --help 本用法 +退出码: 0 成功 / 1 运行期失败 / 2 用法错 +EOF +} + +# 端口守护:dev/start 前清掉残留进程,避免 EADDRINUSE 被静默吞掉(旧进程仍占端口, +# 新进程崩溃但请求全部打到旧实例 → 看起来「改了 seed 但菜单不变」之类的灵异 bug)。 +kill_ports() { + local killed=0 + for p in "$@"; do + local pids + pids="$(lsof -ti:"$p" 2>/dev/null || true)" + if [ -n "$pids" ]; then + echo " ↳ 端口 $p 被旧进程占用 (PID: $pids),清理中…" + # shellcheck disable=SC2086 + kill -9 $pids 2>/dev/null || true + killed=1 + fi + done + # 注意 set -e:端口空闲时 [ ] 返回 1 会炸掉调用方(dev 走不到 start_logged) + [ "$killed" -eq 1 ] && sleep 1 + return 0 +} + +# 用 PID 文件优雅停(先 SIGTERM,1s 后 SIGKILL),清理 root 进程树 +stop_pid() { + local f="$1" + [ -f "$f" ] || return 0 + local pid + pid="$(cat "$f" 2>/dev/null || true)" + if [ -n "$pid" ] && kill -0 "$pid" 2>/dev/null; then + echo " ↳ stop $(basename "$f") PID=$pid SIGTERM" + kill -TERM "$pid" 2>/dev/null || true + sleep 1 + kill -0 "$pid" 2>/dev/null && kill -KILL "$pid" 2>/dev/null || true + fi + rm -f "$f" +} + +# 用 nohup 后台起,stdout/stderr 都进日志;写 PID 便于 ./run.sh stop 精准收 +start_logged() { + local dir="$1" cmd="$2" name="$3" + mkdir -p "$LOGS" + : > "$LOGS/${name}.log" + ( + cd "$ROOT/$dir" || exit 1 + # nohup + & 把子进程从父进程会话脱离,CI/harness 退出不会拖垮服务; + # setsid 让子进程成为新进程组领头,避免父 SIGINT 误杀。 + # macOS 无 setsid(Linux util-linux 专有),探测后回退纯 nohup。 + if command -v setsid >/dev/null 2>&1; then + setsid nohup $cmd > "$LOGS/${name}.log" 2>&1 & + else + nohup $cmd > "$LOGS/${name}.log" 2>&1 & + fi + echo $! > "$RUN/${name}.pid" + ) + echo " ↳ $name PID=$(cat "$RUN/${name}.pid") log=$LOGS/${name}.log" +} + +case "${1:-}" in + -h|--help|help) + usage + ;; + install) + (cd "$ROOT" && cargo fetch) + npm --prefix "$ROOT/src/frontend" install + ;; + build) + (cd "$ROOT" && cargo build --release) + npm --prefix "$ROOT/src/frontend" run build + ;; + dev) + kill_ports "$BACKEND_PORT" "$FRONTEND_PORT" + if [ ! -x "$BACKEND_BIN" ]; then + echo "[启动失败] 后端二进制不存在: $BACKEND_BIN" + echo " 先跑「./run.sh build」(cargo build --release)。" + exit 1 + fi + # 🔴 后端 cwd = 仓库根(dir=".")⇒ 相对路径的 PGLITE_DIR 也落在仓库内。 + # 🔴 命令行**不带** PORT= 前缀 —— PORT 已由 .env / export 导出,子进程继承。 + start_logged . "./target/release/tds-lite-rs" backend + start_logged src/frontend "npm run dev" frontend + echo + echo "服务已在后台启动。后端: http://127.0.0.1:${BACKEND_PORT} 前端: http://127.0.0.1:${FRONTEND_PORT}" + echo "日志:tail -f $LOGS/{backend,frontend}.log" + echo "停止:./run.sh stop" + ;; + backend) + kill_ports "$BACKEND_PORT" + if [ ! -x "$BACKEND_BIN" ]; then + echo "[启动失败] 后端二进制不存在: $BACKEND_BIN" + echo " 先跑「./run.sh build」(cargo build --release)。" + exit 1 + fi + (cd "$ROOT" && exec ./target/release/tds-lite-rs) + ;; + frontend) + kill_ports "$FRONTEND_PORT" + npm --prefix "$ROOT/src/frontend" run dev + ;; + stop) + # ⚠️ vite 是通用名 —— 只有本仓真的起过前端(PID 文件存在)才 pkill,避免误杀别的项目。 + if [ -f "$RUN/frontend.pid" ]; then + pkill -f "vite" 2>/dev/null || true + fi + stop_pid "$RUN/backend.pid" + stop_pid "$RUN/frontend.pid" + kill_ports "$BACKEND_PORT" "$FRONTEND_PORT" + pkill -f "tds-lite-rs" 2>/dev/null || true + echo "stopped" + ;; + logs) + # 🔴 补 || true:日志文件不存在时 [ -f ] 返回 1,set -e 下会让脚本以 1 退出。 + { [ -f "$LOGS/backend.log" ] && echo "=== backend ===" && tail -n 50 "$LOGS/backend.log"; } || true + { [ -f "$LOGS/frontend.log" ] && echo "=== frontend ===" && tail -n 50 "$LOGS/frontend.log"; } || true + ;; + *) + usage + exit 2 + ;; +esac diff --git a/scripts/check-module.sh b/scripts/check-module.sh new file mode 100755 index 0000000..bacea47 --- /dev/null +++ b/scripts/check-module.sh @@ -0,0 +1,332 @@ +#!/usr/bin/env bash +# tds-lite-rs 加业务模块的「接触点」静态自检(Rust 版) +# +# 目的:在跑 perm-smoke 之前,**快速发现漏改的文件或字符串不一致**——这类问题一旦漏掉, +# 表现是「菜单不显示」「页面 404」「权限静默放行」,非常难定位。 +# +# 🔴 **纯静态**:不启动后端、不发一个请求、不依赖 node(契约明令:后端与冒烟脚本零 node 依赖)。 +# ⇒ 用法里**没有** `--live`;传了未知参数 ⇒ 退出码 2(用法错)。 +# +# 用法: +# bash scripts/check-module.sh # 无参 ⇒ 检查全部三个业务模块 +# bash scripts/check-module.sh # 也可只查一个(如 books Book) +# bash scripts/check-module.sh --help # 本用法 +# +# 例: +# bash scripts/check-module.sh # demo / shop / books 全查 +# bash scripts/check-module.sh books Book # 单模块 +# +# 退出码:0 全过 / 1 有 ❌ 项 / 2 用法错 + +set -u + +ROOT="$(cd "$(dirname "$0")/.." && pwd)" + +BACKEND="$ROOT/src/backend" +ENTITIES="$BACKEND/src/entities.rs" +ROUTES="$BACKEND/src/routes.rs" +SCHEMA="$BACKEND/db/schema.sql" +SEED="$BACKEND/src/seed.rs" +CRUD="$BACKEND/src/crud.rs" +FE="$ROOT/src/frontend" + +usage() { + echo "用法: bash scripts/check-module.sh [ ...]" + echo " 无参 ⇒ 检查全部三个业务模块(demo / shop / books)" + echo "例: bash scripts/check-module.sh" + echo " bash scripts/check-module.sh books Book" + echo "退出码: 0 全过 / 1 有 ❌ 项 / 2 用法错" +} + +if [ "${1:-}" = "-h" ] || [ "${1:-}" = "--help" ]; then + usage + exit 0 +fi + +# ---- 目标清单:appCode:Entity ---- +TARGETS=() +if [ "$#" -eq 0 ]; then + TARGETS=("demo:DemoItem" "shop:Product" "books:Book") +else + APP_ARG="$1" + shift + if [ "$#" -eq 0 ]; then + echo "❌ 用法错: 后面至少要跟一个 " + usage + exit 2 + fi + for ENT_ARG in "$@"; do + case "${ENT_ARG}" in + -*) + echo "❌ 未知参数: ${ENT_ARG}" + usage + exit 2 + ;; + esac + TARGETS+=("${APP_ARG}:${ENT_ARG}") + done +fi + +# ---- 期望值表(逐字,来自契约 §8.4 + 契约 §5.3)---- +# 每个目标:表名 / ROUTE(= urlAddress = module_key)/ 种子 id / module_key(None = 仅登录) +T_COUNT=${#TARGETS[@]} +T_APP=(); T_ENT=(); T_TABLE=(); T_ROUTE=(); T_SEED=(); T_MK=() +for T in "${TARGETS[@]}"; do + A="${T%%:*}" + E="${T##*:}" + case "${A}:${E}" in + demo:DemoItem) + T_TABLE+=("demo_item"); T_ROUTE+=("demo-item") + T_SEED+=("m_demo"); T_MK+=("None") + ;; + shop:Product) + T_TABLE+=("shop_product"); T_ROUTE+=("shop/Product") + T_SEED+=("m_product"); T_MK+=("shop/Product") + ;; + books:Book) + T_TABLE+=("book_shop_book"); T_ROUTE+=("books/Book") + T_SEED+=("m_book"); T_MK+=("books/Book") + ;; + *) + echo "❌ 未知 app_code/Entity: ${A}/${E}" + echo " 本仓已知: demo/DemoItem、shop/Product、books/Book" + exit 2 + ;; + esac + T_APP+=("${A}"); T_ENT+=("${E}") +done + +PASS=0; FAIL=0 +ok() { echo " ✅ $1"; PASS=$((PASS+1)); } +no() { echo " ❌ $1"; FAIL=$((FAIL+1)); } +hdr() { echo; echo "── $1 ──"; } + +# 小写(兼容 bash 3.x,不用 ${var,,}) +lower() { printf '%s' "$1" | tr '[:upper:]' '[:lower:]'; } + +# 自然英语复数(兼容 bash 3.x,不依赖 declare -A) +# Apply → Applies / Box → Boxes / Match → Matches / Buy → Buys(y 辅音前) / Boy → Boys +plural() { + case "$1" in + *s|*x|*ch|*sh) echo "${1}es" ;; # -s/-x/-ch/-sh 直接加 es + *ay|*ey|*oy|*uy) echo "${1}s" ;; # 单元音 + y → 保留 +s(Boy → Boys) + *y) echo "${1%y}ies" ;; # 辅音 + y → 去 y 加 ies + *) echo "${1}s" ;; # 默认 +s + esac +} + +# 从 entities.rs 里取某个 spec 的 table 字面量 +spec_table_of() { + awk -v want="$1" ' + /entity: "/ { e = $0; sub(/.*entity: "/, "", e); sub(/".*/, "", e) } + /table: "/ { t = $0; sub(/.*table: "/, "", t); sub(/".*/, "", t); + if (e == want) { print t; exit } } + ' "$ENTITIES" +} + +# 从 entities.rs 里取某个 spec 的 module_key(None 或 Some("x") 的 x) +spec_module_key_of() { + awk -v want="$1" ' + /entity: "/ { e = $0; sub(/.*entity: "/, "", e); sub(/".*/, "", e) } + /module_key:/ { + m = $0; sub(/.*module_key:[[:space:]]*/, "", m); sub(/,[[:space:]]*$/, "", m) + if (e == want) { + if (m ~ /^Some\(/) { s = m; sub(/^Some\("/, "", s); sub(/"\)$/, "", s); print s } + else print "None" + exit + } + } + ' "$ENTITIES" +} + +# 从 seed.rs 里取某个内置菜单 id 的 url_address +seed_url_of() { + awk -v want="$1" ' + /id: "/ { cur = $0; sub(/.*id: "/, "", cur); sub(/".*/, "", cur) } + /url_address: "/ { + u = $0; sub(/.*url_address: "/, "", u); sub(/".*/, "", u) + if (cur == want) { print u; exit } + } + ' "$SEED" +} + +# 从 schema.sql 里取某张表的 CREATE TABLE 块 +schema_block_of() { + awk -v t="$1" ' + $0 ~ ("CREATE TABLE " t " \\(") { inb = 1 } + inb { print } + inb && /^\);/ { exit } + ' "$SCHEMA" +} + +for i in $(seq 0 $((T_COUNT - 1))); do + APP="${T_APP[$i]}" + ENT="${T_ENT[$i]}" + TABLE="${T_TABLE[$i]}" + ROUTE="${T_ROUTE[$i]}" + SEED_ID="${T_SEED[$i]}" + MK="${T_MK[$i]}" + LC="$(lower "$ENT")" + URL="${APP}/${ENT}" + + hdr "[${ENT}] 1) 后端路由注册:routes.rs 含 /api/ssw/${URL}/{List|Save|Delete}" + for ep in List Save Delete; do + if grep -q "/api/ssw/${URL}/${ep}" "$ROUTES" 2>/dev/null; then + ok "routes.rs 已注册 /api/ssw/${URL}/${ep}" + else + no "routes.rs 缺 /api/ssw/${URL}/${ep} → 端点 404" + fi + done + + hdr "[${ENT}] 2) spec 定义:entities.rs 含 entity: \"${ENT}\" + table: \"${TABLE}\"" + if grep -q "entity: \"${ENT}\"" "$ENTITIES" 2>/dev/null; then + ok "entities.rs 含 entity: \"${ENT}\"" + else + no "entities.rs 缺 entity: \"${ENT}\"(spec 没登记这个实体)" + fi + SPEC_TABLE="$(spec_table_of "${ENT}")" + if [ "${SPEC_TABLE}" = "${TABLE}" ]; then + ok "spec.table = ${TABLE}" + else + no "spec.table = ${SPEC_TABLE:-(没取到)},期望 ${TABLE}" + fi + + hdr "[${ENT}] 3) 实体表存在:schema.sql 含 CREATE TABLE ${TABLE}" + if grep -q "CREATE TABLE ${TABLE}" "$SCHEMA" 2>/dev/null; then + ok "schema.sql 有表 ${TABLE}" + else + no "schema.sql 缺表 ${TABLE} → 业务模块跑不起来" + fi + + hdr "[${ENT}] 4) 守卫 module_key:entities.rs 的 spec.module_key" + SPEC_MK="$(spec_module_key_of "${ENT}")" + if [ "${SPEC_MK}" = "${MK}" ]; then + ok "spec.module_key = ${MK}" + else + no "spec.module_key = ${SPEC_MK:-(没取到)},期望 ${MK}" + fi + + hdr "[${ENT}] 5) 前端 api 文件:api/${LC}.ts 含 list/save/delete 三导出" + API="$FE/src/api/${LC}.ts" + VIEW="$FE/src/views/${ENT}.tsx" + if [ -f "$API" ]; then + # 命名约定:list 函数走「自然英语复数」(Book → listBooks / Product → listProducts) + # save/delete 用 Entity 单数(PascalCase),与后端端点命名一致。 + PLURAL_ENT="$(plural "$ENT")" + for fn in "list${PLURAL_ENT}" "save${ENT}" "delete${ENT}"; do + if grep -qE "export[[:space:]]+const[[:space:]]+${fn}" "$API" 2>/dev/null; then + ok "${fn} 导出存在" + else + no "${API} 缺 export const ${fn}(前端解构会 undefined)" + fi + done + else + # 🔴 本仓前端是逐字复制:demo 模块**没有** api 文件, + # views/DemoItem.tsx 直接 request.get('/ssw/demo/DemoItem/List') ⇒ + # 「前端 api 文件」这一接触点对 demo 走**直连分支**(两种都查不到才算 ❌)。 + ok "无 api/${LC}.ts(走 view 直连分支)" + if [ -f "$VIEW" ]; then + for ep in List Save Delete; do + if grep -qE "request\.(get|post|delete)\([^)]*/ssw/${URL}/${ep}" "$VIEW" 2>/dev/null; then + ok "views/${ENT}.tsx 直连 request → /ssw/${URL}/${ep}" + else + no "views/${ENT}.tsx 没有直连 request → /ssw/${URL}/${ep}" + fi + done + else + no "views/${ENT}.tsx 不存在,无法核对直连分支" + fi + fi + + hdr "[${ENT}] 6) 前端页面:views/${ENT}.tsx 存在" + if [ -f "$VIEW" ]; then + ok "views/${ENT}.tsx" + else + no "缺文件: views/${ENT}.tsx" + fi + + hdr "[${ENT}] 7) 前端路由:App.tsx 含 ),BSD grep 不支持 -P 跨行匹配, + # 用 tr 把换行去掉再 grep 最稳。 + if tr '\n' ' ' < "$FE/src/App.tsx" | grep -q "]*path=\"/${ROUTE}\"" 2>/dev/null; then + ok "Route path=\"/${ROUTE}\" 已注册" + else + no "App.tsx 缺 /dev/null; then + ok "list 查询带 f_delete_mark = 0" + else + no "list 查询缺 f_delete_mark = 0 → 软删数据会显示" + fi + if grep -q "SET f_delete_mark = 1" "$CRUD" 2>/dev/null; then + ok "remove 置 f_delete_mark = 1(软删)" + else + no "remove 没软删(应是 UPDATE f_delete_mark=1,非物理 DELETE)" + fi +done + +# -------- 总结 -------- +echo +echo "── 总结 ──" +echo "Modules: ${TARGETS[*]}" +echo "PASS=$PASS FAIL=$FAIL" +if [ "$FAIL" -eq 0 ]; then + echo "全 ✅ 可以跑 perm-smoke 了" +else + echo "有 ❌,请按上面修复后再跑 perm-smoke" +fi + +exit $([ "$FAIL" -eq 0 ] && echo 0 || echo 1) diff --git a/src/frontend/index.html b/src/frontend/index.html new file mode 100644 index 0000000..22e90a6 --- /dev/null +++ b/src/frontend/index.html @@ -0,0 +1,12 @@ + + + + + + SSW JNPF Lite · React MVP + + +
+ + + diff --git a/src/frontend/package-lock.json b/src/frontend/package-lock.json new file mode 100644 index 0000000..a1c4350 --- /dev/null +++ b/src/frontend/package-lock.json @@ -0,0 +1,2115 @@ +{ + "name": "ssw-jnpf-lite-react-frontend", + "version": "0.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "ssw-jnpf-lite-react-frontend", + "version": "0.1.0", + "dependencies": { + "axios": "^1.7.0", + "crypto-js": "^4.2.0", + "react": "^18.3.1", + "react-dom": "^18.3.1", + "react-router-dom": "^6.26.0" + }, + "devDependencies": { + "@types/crypto-js": "^4.2.2", + "@types/react": "^18.3.0", + "@types/react-dom": "^18.3.0", + "@vitejs/plugin-react": "^4.3.0", + "typescript": "^5.4.0", + "vite": "^5.2.0" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.29.7", + "resolved": "https://registry.npmmirror.com/@babel/code-frame/-/code-frame-7.29.7.tgz", + "integrity": "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.29.7", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.29.7", + "resolved": "https://registry.npmmirror.com/@babel/compat-data/-/compat-data-7.29.7.tgz", + "integrity": "sha512-locTkQyKvwIEgBzVrn8693ebc97F2U8ZHjbXwDXJ5Fn2TCpNwTlKcaKLkdHop5c/icOFE7qt7Q9JC5hnKNa6Gg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.29.7", + "resolved": "https://registry.npmmirror.com/@babel/core/-/core-7.29.7.tgz", + "integrity": "sha512-RgHBCvtjbOK2gXSNBNIkNoEc9qoVEtau3hj8gEqKQuL3HZAibKarWFEI3Lfm6EYKkLalOh8eSrj9b+ch9H/VBA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.7", + "@babel/generator": "^7.29.7", + "@babel/helper-compilation-targets": "^7.29.7", + "@babel/helper-module-transforms": "^7.29.7", + "@babel/helpers": "^7.29.7", + "@babel/parser": "^7.29.7", + "@babel/template": "^7.29.7", + "@babel/traverse": "^7.29.7", + "@babel/types": "^7.29.7", + "@jridgewell/remapping": "^2.3.5", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/generator": { + "version": "7.29.8", + "resolved": "https://registry.npmmirror.com/@babel/generator/-/generator-7.29.8.tgz", + "integrity": "sha512-gZbepsdh3WDtgZKWL+vTPh71LSBrm/Y4/QDZBVCcYfmeTEEuoOYwlSy+G1StfJg+/Zy550u/3TATbm7qDbbMtg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.29.8", + "@babel/types": "^7.29.8", + "@jridgewell/gen-mapping": "^0.3.12", + "@jridgewell/trace-mapping": "^0.3.28", + "jsesc": "^3.0.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.29.7", + "resolved": "https://registry.npmmirror.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.29.7.tgz", + "integrity": "sha512-wem6WaBj4NaVYVdNhLPPVacES6ZJ+KBBfSkTMD3YZxbP3rm3Di85tJU5ljaUNhaOynt+Aj0xruhYuzQBt8n71g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.29.7", + "@babel/helper-validator-option": "^7.29.7", + "browserslist": "^4.24.0", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-globals": { + "version": "7.29.7", + "resolved": "https://registry.npmmirror.com/@babel/helper-globals/-/helper-globals-7.29.7.tgz", + "integrity": "sha512-3nQVUAtvkKH9zahfWgw96Jc/uFOmjACE1kQz82E2lqWmHBgjzbNlsC22nuQTfahmWeQtTq5nQ/4Nnd2A1wj4zA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.29.7", + "resolved": "https://registry.npmmirror.com/@babel/helper-module-imports/-/helper-module-imports-7.29.7.tgz", + "integrity": "sha512-ejHwrQQYcm9xnTivShn2IDOlIzInN34AXskvq9QicvCtEzq1Vzclu/tKF8Jq1Cg8JG2GL6/EmjgsCT7lXepE3g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.29.7", + "@babel/types": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.29.7", + "resolved": "https://registry.npmmirror.com/@babel/helper-module-transforms/-/helper-module-transforms-7.29.7.tgz", + "integrity": "sha512-UPUVSyXbOh627KiCIGQSgwWzGeBKLkaJ9PJEdrngIwMSzxLR4jS4+f1f1jb7VzBbg8nFLaYotvVPFCTqdrmTAg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.29.7", + "@babel/helper-validator-identifier": "^7.29.7", + "@babel/traverse": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-plugin-utils": { + "version": "7.29.7", + "resolved": "https://registry.npmmirror.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.29.7.tgz", + "integrity": "sha512-G7sHYigPY17oO5SYWnfD/0MTBwVR781S/JI643e/JhUYgVgWE/61SoW3NH9KWUKyKq5LVh3npif99Wkt6j86Jw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.29.7", + "resolved": "https://registry.npmmirror.com/@babel/helper-string-parser/-/helper-string-parser-7.29.7.tgz", + "integrity": "sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.29.7", + "resolved": "https://registry.npmmirror.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.7.tgz", + "integrity": "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.29.7", + "resolved": "https://registry.npmmirror.com/@babel/helper-validator-option/-/helper-validator-option-7.29.7.tgz", + "integrity": "sha512-N9ZErrD+yW5geCDtBqnOoxmR8+tNKiGuxKlDpuJxfsqpa2dFcexaziGAE/qoHLiDDreVNMupxGmSoNlyvsA3gw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.29.7", + "resolved": "https://registry.npmmirror.com/@babel/helpers/-/helpers-7.29.7.tgz", + "integrity": "sha512-1k2lAGRMfHTcwuNYcCNUmaUffmQv8KWMfh2iJUUeRlwlwH4FdNG7mfPI10NPfLHJFThE4Tyr4mv7kTNZOiPuBg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/template": "^7.29.7", + "@babel/types": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.29.8", + "resolved": "https://registry.npmmirror.com/@babel/parser/-/parser-7.29.8.tgz", + "integrity": "sha512-E8lTAYNB1KW+FH+VGJuZM1ioAx2E6oVlvQFRrf5P8ZZmsiJXYAD9vTFV7yyEURNzgh1dFqMZuO6tUwcARbqFCA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.29.8" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-self": { + "version": "7.29.7", + "resolved": "https://registry.npmmirror.com/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.29.7.tgz", + "integrity": "sha512-TL0hMc9xzy86VD31nUiwzd5otRAcyEPcsegCxolO0PvcXuH1v0kECe/UIznYFihpkvU5wg/jk4v0TTEFfm53fw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-source": { + "version": "7.29.7", + "resolved": "https://registry.npmmirror.com/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.29.7.tgz", + "integrity": "sha512-06IyK09H3wi4cGbhDBwp5gUGo0IKtnYa8tyTiephirPCK6fbobVGiXMMI5zLQ4aKEYP3wZ3ArU44o+8KMrSG/Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/template": { + "version": "7.29.7", + "resolved": "https://registry.npmmirror.com/@babel/template/-/template-7.29.7.tgz", + "integrity": "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.7", + "@babel/parser": "^7.29.7", + "@babel/types": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.29.8", + "resolved": "https://registry.npmmirror.com/@babel/traverse/-/traverse-7.29.8.tgz", + "integrity": "sha512-I5z7H3bf/41ktsNVLtpN0wAa336HkqIHQ5BuPLEhTkt1jVSyZpeNKIzTgEWmlxjdg81R0IgUCcaE+Ok3NvrfZg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.7", + "@babel/generator": "^7.29.8", + "@babel/helper-globals": "^7.29.7", + "@babel/parser": "^7.29.8", + "@babel/template": "^7.29.7", + "@babel/types": "^7.29.8", + "debug": "^4.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types": { + "version": "7.29.8", + "resolved": "https://registry.npmmirror.com/@babel/types/-/types-7.29.8.tgz", + "integrity": "sha512-Vj1jF3cPfxg7OAfoI7QnVKLoILlm2JF9pnVHrX8qx7AHMiYWT+NDAA7jChlNgRS4WTLc/fD1lXLmPixluj+3Gg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.29.7", + "@babel/helper-validator-identifier": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmmirror.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmmirror.com/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmmirror.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.6.0", + "resolved": "https://registry.npmmirror.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz", + "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmmirror.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@napi-rs/lzma-linux-x64-gnu": { + "version": "1.5.1", + "resolved": "https://registry.npmmirror.com/@napi-rs/lzma-linux-x64-gnu/-/lzma-linux-x64-gnu-1.5.1.tgz", + "integrity": "sha512-oTXEIha4SsuXdTA4Iyskj0kpdx2yVXdhd75c2v3xGrHFfVMsbhTPZU/nMPL4sWKo4pBHm3aucLaqGlF696dTyQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^22.20 || ^24.12 || >=25" + } + }, + "node_modules/@remix-run/router": { + "version": "1.23.4", + "resolved": "https://registry.npmmirror.com/@remix-run/router/-/router-1.23.4.tgz", + "integrity": "sha512-q7j5geK7xs3UJSdm9/iytUNclBnLmYx1EnSeCFXHPeutdqgIMeFeHtUZgS3EhlKxdBEAu8OwtJCwmLrEzpSs7Q==", + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@rolldown/pluginutils": { + "version": "1.0.0-beta.27", + "resolved": "https://registry.npmmirror.com/@rolldown/pluginutils/-/pluginutils-1.0.0-beta.27.tgz", + "integrity": "sha512-+d0F4MKMCbeVUJwG96uQ4SgAznZNSq93I3V+9NHA4OpvqG8mRCpGdKmK8l/dl02h2CCDHwW2FqilnTyDcAnqjA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.63.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.63.3.tgz", + "integrity": "sha512-w3Jnvi1ocaVm/c7yVPpfB98XeSRBMyzp6njL5MVVbGyXjpmUkN+s6Hp4t0PqhGCCaI1ZHMKXt/w0lA1RCaLVcw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.63.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.63.3.tgz", + "integrity": "sha512-uI/ESiaIbbRYAEhzy8PCUWDp1hB0bjAqM06mW9flOoNO4Q8DQpeoREhBR5Hegfl+wpXiguyJv6XSPzEN7OxyHQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.63.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.63.3.tgz", + "integrity": "sha512-oxhrd1jmXLwWZ83eQYDXxuqRdkqkzrjR3JobKeuUyfdNZo11FuQIvqEOZhyIT7OBHxXoGslDDjN0cQcM6T0TqQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.63.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.63.3.tgz", + "integrity": "sha512-7/YiIMghVE8DrxKvNdorAaJVdriOFgOIpdStnPx8ppx5zfTwC3jBCSEAIzB7JD5404m65THl6H93UTTVUvypmg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.63.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.63.3.tgz", + "integrity": "sha512-GXFZRRoMAytaI5z6N3Zhfw0WL18Q0M8r95D5hlC4GqE/lGk8pbSJNUBoOWDfbm6dTciqHj2nU87tI5f6XhQiOg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.63.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.63.3.tgz", + "integrity": "sha512-77W+8X3ddYgPxUpB8nZFQs2Mq+wc4HVlcSRtApXLjYBcnPMkttrSnU8VwKQjeWYhMsITHFs5cWBQ8vz1Q+5RHQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.63.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.63.3.tgz", + "integrity": "sha512-FVkwK+iUC+mq+GipVK46rRVticfAPtvPUNlqlGXUDxdVk/UGjQiiiUVPUrEXdSpU2ufU0XxLGyTqDtBidDOVmg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.63.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.63.3.tgz", + "integrity": "sha512-+aGU1t3398yQOVj1Bz8o3e+KtswxAPvO+mtxtNdfXYMkXIHu7XhhkCD7/DEH9q8tF8uhDnMWvfpUKI8y1sZJsg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.63.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.63.3.tgz", + "integrity": "sha512-cR0kjpRXR2KJ2oQK8E2KTPtphs+b9hZ8IhTZubNryt/RsqgdOZBQ2Zq0q5UedtiIi0rs3jVhJh55RE1ZHUVGUA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.63.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.63.3.tgz", + "integrity": "sha512-y1RYi4Q3/9ByVWSSt9kX2ustE0B7kFYbJ6zZdVZVyqopZs3yhCTwRfrjIX4vezUJInma/Gs6BOFDJg7yZmJ0IQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-gnu": { + "version": "4.63.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.63.3.tgz", + "integrity": "sha512-DNhEA5viIj3Z5bZLE4z4oV8N5ozWqDwyt7T6KG7VdLDJ0nW+rNOYlphBl4/3HQkK75qipPLsVOfStHHOwN9WSg==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-musl": { + "version": "4.63.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.63.3.tgz", + "integrity": "sha512-17gQCqrIpXBX2Cmi9/TygnVOqGbzsba/iaqcYSL8FY7lNugg+7AiYNs5c5nKWD+NRQha36Sa0CqkJqH4XVHwnQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-gnu": { + "version": "4.63.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.63.3.tgz", + "integrity": "sha512-6LwVnZRIyINpdku/yOcI8Tm9YqLmhHK5emmlOOnW9tO0SYEm1FmKPcsSAGp0NBlqR2P04xaND4jvN6sTHqhq8A==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-musl": { + "version": "4.63.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.63.3.tgz", + "integrity": "sha512-xMUqkTXlEUtI/p5AAukMwBRr1enU3efsTeF+bskeFfk8t1C9rcC8sLREcZXmTfAXEbvRdJVSonVJez3TMlbR3w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.63.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.63.3.tgz", + "integrity": "sha512-S3E94co9F9WRRqEaUoQZ38K1gCz6KiM+nL7/3ijq7fDGF3OznjS5TasgYITlvl27GQKtu4lOAOsr5MFwkijvOA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-musl": { + "version": "4.63.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.63.3.tgz", + "integrity": "sha512-1QtRDwG42x5BJI3s9mxu5rEjDnfbSnk20HQ9/ylTAYnSwYwxMVb+Vgu34wzzTQ7ogqBybebgQNUDAvZVQ38DbA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.63.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.63.3.tgz", + "integrity": "sha512-BQhejF6ZXOpxbngiNTP12GCGQeaDVL2QXGeBVViKIYzFHM5RKxTxwUMB1fr1BeNFphFMpnRqC5QSXFSa4z6UQw==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.63.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.63.3.tgz", + "integrity": "sha512-SXagRwnI2Wlwlitllu59UK/nGVbD1CKPcNqDplHwIC4BqJcpXFjD32d1R/RbuISa95HdQrZM3/7v4bKiowFaLA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.63.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.63.3.tgz", + "integrity": "sha512-2IPozoEALRCziGqE8O9KMK60PMu5TS1huv4fwoeCexj+WjmcwFtX9CTOVbfXCUqcELAubEwRFPYlzb/WvwY2HQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-openbsd-x64": { + "version": "4.63.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.63.3.tgz", + "integrity": "sha512-AoxqosUHT9IX54hFn2TiN6A7d6ZKTtE6pd2bqWtqkkNJ6HJGaU6FRouGX8L1O7R/ZwsnCnpQrHzb4pDEx+UHRQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ] + }, + "node_modules/@rollup/rollup-openharmony-arm64": { + "version": "4.63.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.63.3.tgz", + "integrity": "sha512-d+CaftKgmkFBzCwezMqqy1d0QNNYugqLCMcYVQWBy5SS2YfeMP8Q8ripkgx9O8IyBXXLHrJ+aaCV4U96usv6Yg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.63.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.63.3.tgz", + "integrity": "sha512-xXlDF6nR1eOuXbdDy5Hl5fmtY7teUDevF/k0O7IPoZe4Tpmdv+lgdE5JRsnhQtt37ql9P0VF2kAN9a0OCZdo+Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.63.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.63.3.tgz", + "integrity": "sha512-YtXAgLN+JP7Ay6qG3eWhc7IHMQPzLc8r3uvhAvlJIoCz/4Q32+Bl9Fmnywidh8v1GOIMmymjovfqY9ETAtysvA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-gnu": { + "version": "4.63.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.63.3.tgz", + "integrity": "sha512-WuWtSJRNo549vzcfZyEgfqb6zeSgn1F+UE5kQ+BCjzz0W4MGCjntUHkZVc1VRuAM7+ULaSyhiPxD1spyewFvkQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.63.3", + "resolved": "https://registry.npmmirror.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.63.3.tgz", + "integrity": "sha512-+lIKX7O0+IGe7WuhATaAMMeT7B76vfhXH/l9wLQL+nvyhbw2ohYCKIdWL56JfDu75CWt5oKRP4QFH/jkMtBquA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@types/babel__core": { + "version": "7.20.5", + "resolved": "https://registry.npmmirror.com/@types/babel__core/-/babel__core-7.20.5.tgz", + "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" + } + }, + "node_modules/@types/babel__generator": { + "version": "7.27.0", + "resolved": "https://registry.npmmirror.com/@types/babel__generator/-/babel__generator-7.27.0.tgz", + "integrity": "sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__template": { + "version": "7.4.4", + "resolved": "https://registry.npmmirror.com/@types/babel__template/-/babel__template-7.4.4.tgz", + "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__traverse": { + "version": "7.28.0", + "resolved": "https://registry.npmmirror.com/@types/babel__traverse/-/babel__traverse-7.28.0.tgz", + "integrity": "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.28.2" + } + }, + "node_modules/@types/crypto-js": { + "version": "4.2.2", + "resolved": "https://registry.npmmirror.com/@types/crypto-js/-/crypto-js-4.2.2.tgz", + "integrity": "sha512-sDOLlVbHhXpAUAL0YHDUUwDZf3iN4Bwi4W6a0W0b+QcAezUbRtH4FVb+9J4h+XFPW7l/gQ9F8qC7P+Ec4k8QVQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/estree": { + "version": "1.0.9", + "resolved": "https://registry.npmmirror.com/@types/estree/-/estree-1.0.9.tgz", + "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/prop-types": { + "version": "15.7.15", + "resolved": "https://registry.npmmirror.com/@types/prop-types/-/prop-types-15.7.15.tgz", + "integrity": "sha512-F6bEyamV9jKGAFBEmlQnesRPGOQqS2+Uwi0Em15xenOxHaf2hv6L8YCVn3rPdPJOiJfPiCnLIRyvwVaqMY3MIw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/react": { + "version": "18.3.31", + "resolved": "https://registry.npmmirror.com/@types/react/-/react-18.3.31.tgz", + "integrity": "sha512-vfEqpXTvwT91yhmwdfouStN2hSKwTvyRs8qpLfADyrq/kxDw0hZM7Wk9Ug1FELj8hIby+S/+kQCSRFF32nv2Qw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/prop-types": "*", + "csstype": "^3.2.2" + } + }, + "node_modules/@types/react-dom": { + "version": "18.3.7", + "resolved": "https://registry.npmmirror.com/@types/react-dom/-/react-dom-18.3.7.tgz", + "integrity": "sha512-MEe3UeoENYVFXzoXEWsvcpg6ZvlrFNlOQ7EOsvhI3CfAXwzPfO8Qwuxd40nepsYKqyyVQnTdEfv68q91yLcKrQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@types/react": "^18.0.0" + } + }, + "node_modules/@vitejs/plugin-react": { + "version": "4.7.0", + "resolved": "https://registry.npmmirror.com/@vitejs/plugin-react/-/plugin-react-4.7.0.tgz", + "integrity": "sha512-gUu9hwfWvvEDBBmgtAowQCojwZmJ5mcLn3aufeCsitijs3+f2NsrPtlAWIR6OPiqljl96GVCUbLe0HyqIpVaoA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.28.0", + "@babel/plugin-transform-react-jsx-self": "^7.27.1", + "@babel/plugin-transform-react-jsx-source": "^7.27.1", + "@rolldown/pluginutils": "1.0.0-beta.27", + "@types/babel__core": "^7.20.5", + "react-refresh": "^0.17.0" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "peerDependencies": { + "vite": "^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0" + } + }, + "node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmmirror.com/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "license": "MIT", + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmmirror.com/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "license": "MIT" + }, + "node_modules/axios": { + "version": "1.20.0", + "resolved": "https://registry.npmmirror.com/axios/-/axios-1.20.0.tgz", + "integrity": "sha512-r8aOh8j9cGKpgQAqpzrUHnSIc6a59Y3Xf/cv8sy1DrHCkZHzQGEuoq1tARk6qSyDdtQGSDgpb9kFlruzPvrgwg==", + "license": "MIT", + "dependencies": { + "follow-redirects": "^1.16.0", + "form-data": "^4.0.6", + "https-proxy-agent": "^5.0.1", + "proxy-from-env": "^2.1.0" + } + }, + "node_modules/baseline-browser-mapping": { + "version": "2.11.24", + "resolved": "https://registry.npmmirror.com/baseline-browser-mapping/-/baseline-browser-mapping-2.11.24.tgz", + "integrity": "sha512-hYrgxie335U08WqICoGqKRzV1HFXv6zdxwJE4ekCb80CM9a0SVVsN4QPwT67RraRo+9h8IATk6uxHJw7QSkdOg==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "baseline-browser-mapping": "dist/cli.cjs" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/browserslist": { + "version": "4.29.0", + "resolved": "https://registry.npmmirror.com/browserslist/-/browserslist-4.29.0.tgz", + "integrity": "sha512-3GSvyjvDI4Dur1Meg2BekJquu5uF+9R9a1+5M1Mde192eZoXbeXjzgOsgqPS2V8D5wrrip0gR5Hf/GhWQ9ZzaA==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "baseline-browser-mapping": "^2.11.23", + "caniuse-lite": "^1.0.30001810", + "electron-to-chromium": "^1.5.427", + "node-releases": "^2.0.55", + "update-browserslist-db": "^1.3.3" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/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/caniuse-lite": { + "version": "1.0.30001810", + "resolved": "https://registry.npmmirror.com/caniuse-lite/-/caniuse-lite-1.0.30001810.tgz", + "integrity": "sha512-TITQPUkaz+aVk5GL6NhOdwk1aEaNTSDPsGFWrTuhKGtjTF70jL/Oht2W4c6rXUe5fu7Ie19VIahAXHIIiWWNeg==", + "dev": true, + "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/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmmirror.com/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "license": "MIT", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmmirror.com/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true, + "license": "MIT" + }, + "node_modules/crypto-js": { + "version": "4.2.0", + "resolved": "https://registry.npmmirror.com/crypto-js/-/crypto-js-4.2.0.tgz", + "integrity": "sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q==", + "deprecated": "Active development of CryptoJS has been discontinued. This library is no longer maintained.", + "license": "MIT" + }, + "node_modules/csstype": { + "version": "3.2.3", + "resolved": "https://registry.npmmirror.com/csstype/-/csstype-3.2.3.tgz", + "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmmirror.com/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/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/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/electron-to-chromium": { + "version": "1.5.430", + "resolved": "https://registry.npmmirror.com/electron-to-chromium/-/electron-to-chromium-1.5.430.tgz", + "integrity": "sha512-e1QEj72Y4zd8RlNZVmoTg+iCOSVwpk05IOiiQwdrkwCSVlZfPthevErhE+nckGd2YbsXfp1SkisznhGVIXP2NQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmmirror.com/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.npmmirror.com/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.npmmirror.com/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/es-set-tostringtag": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/esbuild": { + "version": "0.21.5", + "resolved": "https://registry.npmmirror.com/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmmirror.com/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/follow-redirects": { + "version": "1.16.0", + "resolved": "https://registry.npmmirror.com/follow-redirects/-/follow-redirects-1.16.0.tgz", + "integrity": "sha512-y5rN/uOsadFT/JfYwhxRS5R7Qce+g3zG97+JrtFZlC9klX/W5hD7iiLzScI4nZqUS7DNUdhPgw4xI8W2LuXlUw==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "license": "MIT", + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/form-data": { + "version": "4.0.6", + "resolved": "https://registry.npmmirror.com/form-data/-/form-data-4.0.6.tgz", + "integrity": "sha512-vKatAh4SlVfgbv+YtmhiRjhEMJsYpsG1Y2rMQtR+SVSbytsSD1YGzDIcrAJmdFec88u/+VoGmxnl+80gL1tRCQ==", + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.4", + "mime-types": "^2.1.35" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmmirror.com/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmmirror.com/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmmirror.com/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmmirror.com/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.npmmirror.com/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/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmmirror.com/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.npmmirror.com/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/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmmirror.com/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.4", + "resolved": "https://registry.npmmirror.com/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/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmmirror.com/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "license": "MIT", + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmmirror.com/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "license": "MIT" + }, + "node_modules/jsesc": { + "version": "3.1.0", + "resolved": "https://registry.npmmirror.com/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", + "dev": true, + "license": "MIT", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmmirror.com/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true, + "license": "MIT", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmmirror.com/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "license": "MIT", + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, + "node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmmirror.com/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmmirror.com/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmmirror.com/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.npmmirror.com/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/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmmirror.com/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/nanoid": { + "version": "3.3.19", + "resolved": "https://registry.npmmirror.com/nanoid/-/nanoid-3.3.19.tgz", + "integrity": "sha512-Y2tUNy4ouw6tq5oDSKeQYGOyhkUBhNOcGV/02KC+6kd9eDGqdZd++mjMiIDilrBYvjEnCYvVtsuHCuP+okSfug==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/node-releases": { + "version": "2.0.55", + "resolved": "https://registry.npmmirror.com/node-releases/-/node-releases-2.0.55.tgz", + "integrity": "sha512-mIrE/Cw9y+9Au6dS5vDKDhQza9YvG6w+ZrS6X+ZzA7yFW/soAeaups4Qzn1bL6g5FVy8WtP79+0j82oPIbqRjQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" + }, + "node_modules/postcss": { + "version": "8.5.28", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-8.5.28.tgz", + "integrity": "sha512-RRuzqDtt5Y9h3quz5hWhK+TPnsmVs6WwSU6LkJMeY4HstUEDuYTG8UJSdawMRzmzAtV+KEoG8N3Qg2qLy5vM/A==", + "dev": true, + "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.18", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/proxy-from-env": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/proxy-from-env/-/proxy-from-env-2.1.0.tgz", + "integrity": "sha512-cJ+oHTW1VAEa8cJslgmUZrc+sjRKgAKl3Zyse6+PV38hZe/V6Z14TbCuXcan9F9ghlz4QrFr2c92TNF82UkYHA==", + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/react": { + "version": "18.3.1", + "resolved": "https://registry.npmmirror.com/react/-/react-18.3.1.tgz", + "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-dom": { + "version": "18.3.1", + "resolved": "https://registry.npmmirror.com/react-dom/-/react-dom-18.3.1.tgz", + "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.1.0", + "scheduler": "^0.23.2" + }, + "peerDependencies": { + "react": "^18.3.1" + } + }, + "node_modules/react-refresh": { + "version": "0.17.0", + "resolved": "https://registry.npmmirror.com/react-refresh/-/react-refresh-0.17.0.tgz", + "integrity": "sha512-z6F7K9bV85EfseRCp2bzrpyQ0Gkw1uLoCel9XBVWPg/TjRj94SkJzUTGfOa4bs7iJvBWtQG0Wq7wnI0syw3EBQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-router": { + "version": "6.30.6", + "resolved": "https://registry.npmmirror.com/react-router/-/react-router-6.30.6.tgz", + "integrity": "sha512-5HfK7k5im7LTOB0EqCQmfvy4C13G92Ssj1VTmouTK3AJvyjKTnFuCV0vcMAD/JS+JC4DvDIBRrlAeJIFjh5VWg==", + "license": "MIT", + "dependencies": { + "@remix-run/router": "1.23.4" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "react": ">=16.8" + } + }, + "node_modules/react-router-dom": { + "version": "6.30.6", + "resolved": "https://registry.npmmirror.com/react-router-dom/-/react-router-dom-6.30.6.tgz", + "integrity": "sha512-0RHKZz7wwffvkU+2MFVT2NnjK44ssLEV+m0CAJaS2Ksmorrwj7WxH00jO0SOCW26/tINUnJHToXblDs33I38YQ==", + "license": "MIT", + "dependencies": { + "@remix-run/router": "1.23.4", + "react-router": "6.30.6" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "react": ">=16.8", + "react-dom": ">=16.8" + } + }, + "node_modules/rollup": { + "version": "4.63.3", + "resolved": "https://registry.npmmirror.com/rollup/-/rollup-4.63.3.tgz", + "integrity": "sha512-1i2XreiAoMMXuPGD6Msj2xWrMMkHojNRKivInxGQcg7/1KuPuYlfUutLyh4drnOxUTHX9cHI4wFoat8D/NKaBw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "1.0.9" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@napi-rs/lzma-linux-x64-gnu": "1.5.1", + "@rollup/rollup-android-arm-eabi": "4.63.3", + "@rollup/rollup-android-arm64": "4.63.3", + "@rollup/rollup-darwin-arm64": "4.63.3", + "@rollup/rollup-darwin-x64": "4.63.3", + "@rollup/rollup-freebsd-arm64": "4.63.3", + "@rollup/rollup-freebsd-x64": "4.63.3", + "@rollup/rollup-linux-arm-gnueabihf": "4.63.3", + "@rollup/rollup-linux-arm-musleabihf": "4.63.3", + "@rollup/rollup-linux-arm64-gnu": "4.63.3", + "@rollup/rollup-linux-arm64-musl": "4.63.3", + "@rollup/rollup-linux-loong64-gnu": "4.63.3", + "@rollup/rollup-linux-loong64-musl": "4.63.3", + "@rollup/rollup-linux-ppc64-gnu": "4.63.3", + "@rollup/rollup-linux-ppc64-musl": "4.63.3", + "@rollup/rollup-linux-riscv64-gnu": "4.63.3", + "@rollup/rollup-linux-riscv64-musl": "4.63.3", + "@rollup/rollup-linux-s390x-gnu": "4.63.3", + "@rollup/rollup-linux-x64-gnu": "4.63.3", + "@rollup/rollup-linux-x64-musl": "4.63.3", + "@rollup/rollup-openbsd-x64": "4.63.3", + "@rollup/rollup-openharmony-arm64": "4.63.3", + "@rollup/rollup-win32-arm64-msvc": "4.63.3", + "@rollup/rollup-win32-ia32-msvc": "4.63.3", + "@rollup/rollup-win32-x64-gnu": "4.63.3", + "@rollup/rollup-win32-x64-msvc": "4.63.3", + "fsevents": "~2.3.2" + } + }, + "node_modules/scheduler": { + "version": "0.23.2", + "resolved": "https://registry.npmmirror.com/scheduler/-/scheduler-0.23.2.tgz", + "integrity": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.1.0" + } + }, + "node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmmirror.com/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmmirror.com/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmmirror.com/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/update-browserslist-db": { + "version": "1.3.3", + "resolved": "https://registry.npmmirror.com/update-browserslist-db/-/update-browserslist-db-1.3.3.tgz", + "integrity": "sha512-pJ2sYawQS0R/WI928Gj5GlPhTGzbMelq0+4INtSYNDV9ErKJcX6xjGWkoG/VnB3dpUm00zALaqkrUD77pO5TDQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/vite": { + "version": "5.4.21", + "resolved": "https://registry.npmmirror.com/vite/-/vite-5.4.21.tgz", + "integrity": "sha512-o5a9xKjbtuhY6Bi5S3+HvbRERmouabWbyUcpXXUA1u+GNUKoROi9byOJ8M0nHbHYHkYICiMlqxkg1KkYmm25Sw==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "^0.21.3", + "postcss": "^8.4.43", + "rollup": "^4.20.0" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^18.0.0 || >=20.0.0", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "sass-embedded": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.4.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + } + } + }, + "node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmmirror.com/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true, + "license": "ISC" + } + } +} diff --git a/src/frontend/package.json b/src/frontend/package.json new file mode 100644 index 0000000..f9dec87 --- /dev/null +++ b/src/frontend/package.json @@ -0,0 +1,27 @@ +{ + "name": "ssw-jnpf-lite-react-frontend", + "private": true, + "version": "0.1.0", + "type": "module", + "scripts": { + "dev": "vite", + "build": "vite build", + "typecheck": "tsc --noEmit", + "preview": "vite preview" + }, + "dependencies": { + "axios": "^1.7.0", + "crypto-js": "^4.2.0", + "react": "^18.3.1", + "react-dom": "^18.3.1", + "react-router-dom": "^6.26.0" + }, + "devDependencies": { + "@types/crypto-js": "^4.2.2", + "@types/react": "^18.3.0", + "@types/react-dom": "^18.3.0", + "@vitejs/plugin-react": "^4.3.0", + "typescript": "^5.4.0", + "vite": "^5.2.0" + } +} diff --git a/src/frontend/src/App.tsx b/src/frontend/src/App.tsx new file mode 100644 index 0000000..d3f21f9 --- /dev/null +++ b/src/frontend/src/App.tsx @@ -0,0 +1,91 @@ +import { Routes, Route, Navigate, useLocation } from 'react-router-dom'; +import { JSX } from 'react'; +import Login from './views/Login'; +import Dashboard from './views/Dashboard'; +import DemoItem from './views/DemoItem'; +import Product from './views/Product'; +import Book from './views/Book'; +import UserManage from './views/UserManage'; +import RoleManage from './views/RoleManage'; +import OrganizeManage from './views/OrganizeManage'; +import MenuManage from './views/MenuManage'; +import { getToken } from './api/request'; + +function RequireAuth({ children }: { children: JSX.Element }) { + const token = getToken(); + const location = useLocation(); + if (!token) return ; + return children; +} + +export default function App() { + return ( + + } /> + + + + } + /> + + + + } + /> + + + + } + /> + + + + } + /> + + + + } + /> + + + + } + /> + + + + } + /> + + + + } + /> + + ); +} diff --git a/src/frontend/src/api/auth.ts b/src/frontend/src/api/auth.ts new file mode 100644 index 0000000..24cad54 --- /dev/null +++ b/src/frontend/src/api/auth.ts @@ -0,0 +1,19 @@ +import request from './request'; + +export async function login(account: string, passwordHex: string) { + const params = new URLSearchParams(); + params.set('account', account); + params.set('password', passwordHex); + params.set('grant_type', 'password'); + // Content-Type: application/x-www-form-urlencoded,与 JNPF 登录一致 + return (await request.post('/oauth/Login', params.toString(), { + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + })) as { token: string; expiresIn: number; tokenTypeName: string }; +} + +export async function currentUser() { + return (await request.get('/oauth/CurrentUser')) as { + userInfo: any; + menuList: any[]; + }; +} diff --git a/src/frontend/src/api/book.ts b/src/frontend/src/api/book.ts new file mode 100644 index 0000000..5c9d744 --- /dev/null +++ b/src/frontend/src/api/book.ts @@ -0,0 +1,5 @@ +import request from './request'; + +export const listBooks = () => request.get('/ssw/books/Book/List'); +export const saveBook = (dto: any) => request.post('/ssw/books/Book/Save', dto); +export const deleteBook = (id: string) => request.delete(`/ssw/books/Book/Delete?id=${id}`); \ No newline at end of file diff --git a/src/frontend/src/api/product.ts b/src/frontend/src/api/product.ts new file mode 100644 index 0000000..3ad40fc --- /dev/null +++ b/src/frontend/src/api/product.ts @@ -0,0 +1,7 @@ +import request from './request'; + +// Product 业务 API —— 端点与后端 @Controller('api/ssw/shop/Product') 对应 +export const listProducts = () => request.get('/ssw/shop/Product/List'); +export const saveProduct = (dto: any) => request.post('/ssw/shop/Product/Save', dto); +export const deleteProduct = (id: string) => + request.delete(`/ssw/shop/Product/Delete?id=${id}`); diff --git a/src/frontend/src/api/request.ts b/src/frontend/src/api/request.ts new file mode 100644 index 0000000..aecc279 --- /dev/null +++ b/src/frontend/src/api/request.ts @@ -0,0 +1,72 @@ +import axios, { AxiosError, AxiosInstance } from 'axios'; + +/** + * 请求层 —— 复刻 JNPF/jweb 的 ActionResult 适配语义: + * - 统一 baseURL '/api'(dev 由 vite proxy 转发到 30000) + * - 拦截器处理 code:600/601/602 -> 清 token 跳 /login(对齐 jweb enum.ts: TOKEN_TIMEOUT/TOKEN_LOGGED/TOKEN_ERROR) + * - code !== 200 -> reject + * - 成功时把 ActionResult 的 data 解包抛给调用方 + * 迁 jweb(Vue) 时这些逻辑 1:1 对应 vben 的 defHttp 拦截器,前端零改。 + */ +const TOKEN_KEY = 'ssw_token'; + +export function getToken(): string | null { + return localStorage.getItem(TOKEN_KEY); +} +export function setToken(raw: string) { + const t = raw.startsWith('bearer ') ? raw : `bearer ${raw}`; + localStorage.setItem(TOKEN_KEY, t); +} +export function clearToken() { + localStorage.removeItem(TOKEN_KEY); +} + +interface SswRequest extends AxiosInstance { + get(url: string, config?: any): Promise; + post(url: string, data?: any, config?: any): Promise; + put(url: string, data?: any, config?: any): Promise; + delete(url: string, config?: any): Promise; +} + +const request = axios.create({ baseURL: '/api', timeout: 30000 }) as SswRequest; + +request.interceptors.request.use((config) => { + const token = getToken(); + config.headers.set('App-Code', 'sswflow'); + config.headers.set('Jnpf-Origin', 'pc'); + if (token) config.headers.set('Authorization', token); + return config; +}); + +function redirectLogin() { + if (location.pathname !== '/login') { + location.replace(`/login?next=${encodeURIComponent(location.pathname + location.search)}`); + } +} + +request.interceptors.response.use( + (resp) => { + const body = resp.data || {}; + if (body.code === 600 || body.code === 601 || body.code === 602) { + clearToken(); + redirectLogin(); + return Promise.reject(new Error('NOT_LOGIN')); + } + if (body.code !== undefined && body.code !== 200) { + return Promise.reject(new Error(body.msg || '操作失败')); + } + return body.data !== undefined ? body.data : body; + }, + (error: AxiosError) => { + const status = error.response?.status; + const body: any = error.response?.data || {}; + if (status === 401 || body.code === 600 || body.code === 601 || body.code === 602) { + clearToken(); + redirectLogin(); + return Promise.reject(new Error('NOT_LOGIN')); + } + return Promise.reject(new Error(body.msg || error.message || '请求失败')); + }, +); + +export default request; diff --git a/src/frontend/src/api/sys.ts b/src/frontend/src/api/sys.ts new file mode 100644 index 0000000..b20a40d --- /dev/null +++ b/src/frontend/src/api/sys.ts @@ -0,0 +1,36 @@ +import request from './request'; + +// 用户 +export const listUsers = () => request.get('/ssw/sys/User/List'); +export const saveUser = (dto: any) => request.post('/ssw/sys/User/Save', dto); +export const deleteUser = (id: string) => + request.delete(`/ssw/sys/User/Delete?id=${id}`); + +// 角色 +export const listRoles = () => request.get('/ssw/sys/Role/List'); +export const saveRole = (dto: any) => request.post('/ssw/sys/Role/Save', dto); +export const deleteRole = (id: string) => + request.delete(`/ssw/sys/Role/Delete?id=${id}`); +export const roleModules = (roleId: string) => + request.get(`/ssw/sys/Role/Modules?roleId=${roleId}`); + +// 机构 +export const listOrganize = () => request.get('/ssw/sys/Organize/List'); +export const saveOrganize = (dto: any) => request.post('/ssw/sys/Organize/Save', dto); +export const deleteOrganize = (id: string) => + request.delete(`/ssw/sys/Organize/Delete?id=${id}`); + +// 菜单 +export const listModules = () => request.get('/ssw/sys/Module/List'); +export const saveModule = (dto: any) => request.post('/ssw/sys/Module/Save', dto); +export const deleteModule = (id: string) => + request.delete(`/ssw/sys/Module/Delete?id=${id}`); + +// 统一授权(角色→菜单,对齐 JNPF PUT /api/permission/Authority/Data/{objectId}) +// module 是一维 String[](官方 AuthorizeDataUpForm.module = String[]); +// 半选节点由调用方合并进同一数组(对齐 MenuAuth.vue: [...checkedKeys, ...halfCheckedKeys]) +export const saveRoleModules = (roleId: string, moduleIds: string[]) => + request.put(`/permission/Authority/Data/${roleId}`, { + objectType: 'role', + module: moduleIds, + }); diff --git a/src/frontend/src/main.tsx b/src/frontend/src/main.tsx new file mode 100644 index 0000000..6291701 --- /dev/null +++ b/src/frontend/src/main.tsx @@ -0,0 +1,12 @@ +import React from 'react'; +import ReactDOM from 'react-dom/client'; +import { BrowserRouter } from 'react-router-dom'; +import App from './App'; + +ReactDOM.createRoot(document.getElementById('root')!).render( + + + + + , +); diff --git a/src/frontend/src/utils/cipher.ts b/src/frontend/src/utils/cipher.ts new file mode 100644 index 0000000..a33f030 --- /dev/null +++ b/src/frontend/src/utils/cipher.ts @@ -0,0 +1,26 @@ +import CryptoJS from 'crypto-js'; + +/** + * 登录密码加密 —— 与 JNPF 后端 LiteLoginController / dacli / ssw-jnpf-lite(Vue) 完全一致。 + * 检验向量:encryptPassword('123456') === + * 'd4958348e22108119b3ef57b022c83f4bf857dd0b247eaab15b9a43d47ee3c503900f7135bf0de255bc33620c3cdc02b' + */ +const CIPHER_KEY = 'EY8WePvjM5GGwQzn'; + +function md5(str: string): string { + return CryptoJS.MD5(str).toString(); +} + +export function encryptPassword(plain: string): string { + const key = CryptoJS.enc.Utf8.parse(md5(CIPHER_KEY)); + const src = CryptoJS.enc.Utf8.parse(md5(plain)); + return CryptoJS.AES.encrypt(src, key, { + mode: CryptoJS.mode.ECB, + padding: CryptoJS.pad.Pkcs7, + }) + .ciphertext.toString(CryptoJS.enc.Hex); +} + +export function md5Hex(str: string): string { + return md5(str); +} diff --git a/src/frontend/src/views/Book.tsx b/src/frontend/src/views/Book.tsx new file mode 100644 index 0000000..b66a094 --- /dev/null +++ b/src/frontend/src/views/Book.tsx @@ -0,0 +1,155 @@ +import { useEffect, useState } from 'react'; +import { listBooks, saveBook, deleteBook } from '../api/book'; +import { wrap, card, btn, btnDanger, input as inputStyle, tableStyle, th, td } from './ui'; + +// 字段用去前缀名:id / title / author / isbn / category / price / stock +// (JNPF 后端 Jackson 会剥掉 f_ 前缀) +interface Book { + id: string; + title?: string; + author?: string; + isbn?: string; + category?: string; + price?: string; + stock?: number; +} + +export default function Books() { + const [items, setItems] = useState([]); + const [form, setForm] = useState({ + title: '', + author: '', + isbn: '', + category: '', + price: '', + stock: '', + }); + + async function load() { + const data = await listBooks(); + setItems(data || []); + } + useEffect(() => { + load(); + }, []); + + function update(k: keyof Book, v: string) { + setForm((f) => ({ ...f, [k]: v })); + } + + async function add() { + if (!form.title) return; + await saveBook({ + title: form.title, + author: form.author || undefined, + isbn: form.isbn || undefined, + category: form.category || undefined, + price: form.price || '0.00', + stock: form.stock ? Number(form.stock) : 0, + }); + setForm({ title: '', author: '', isbn: '', category: '', price: '', stock: '' }); + load(); + } + async function del(id: string) { + await deleteBook(id); + load(); + } + + return ( +
+
+

图书超市

+
+ update('title', e.target.value)} + placeholder="书名" + style={inputStyle} + /> + update('author', e.target.value)} + placeholder="作者" + style={inputStyle} + /> + update('isbn', e.target.value)} + placeholder="ISBN" + style={inputStyle} + /> + update('category', e.target.value)} + placeholder="分类" + style={inputStyle} + /> + update('price', e.target.value)} + placeholder="价格" + style={inputStyle} + /> + update('stock', e.target.value)} + placeholder="库存" + style={inputStyle} + /> +
+
+ + +
+ + + + + + + + + + + + + + {items.map((it) => ( + + + + + + + + + + ))} + {items.length === 0 && ( + + + + )} + +
书名作者ISBN分类价格库存操作
{it.title}{it.author}{it.isbn}{it.category}¥{it.price}{it.stock} + +
+ 暂无数据 +
+
+
+ ); +} \ No newline at end of file diff --git a/src/frontend/src/views/Dashboard.tsx b/src/frontend/src/views/Dashboard.tsx new file mode 100644 index 0000000..96d0283 --- /dev/null +++ b/src/frontend/src/views/Dashboard.tsx @@ -0,0 +1,64 @@ +import { useEffect, useState } from 'react'; +import { useNavigate } from 'react-router-dom'; +import { currentUser } from '../api/auth'; +import { clearToken } from '../api/request'; +import { wrap, card, btnGhost, btn } from './ui'; + +interface MenuNode { + id: string; + fullName: string; + urlAddress?: string; + icon?: string; + parentId: string; + children: MenuNode[]; +} + +export default function Dashboard() { + const nav = useNavigate(); + const [menu, setMenu] = useState([]); + const [user, setUser] = useState(null); + + useEffect(() => { + currentUser() + .then((d) => { + setMenu(d.menuList || []); + setUser(d.userInfo); + }) + .catch(() => {}); + }, []); + + function goto(addr?: string) { + if (addr) nav('/' + addr); + } + function logout() { + clearToken(); + location.reload(); + } + + return ( +
+
+

SSW JNPF Lite · React

+
+ {user?.userAccount} {user?.isAdministrator ? '(管理员)' : ''} +
+

功能菜单

+ {menu.map((node) => ( +
+
{node.fullName}
+
+ {node.children.map((c) => ( + + ))} +
+
+ ))} + +
+
+ ); +} diff --git a/src/frontend/src/views/DemoItem.tsx b/src/frontend/src/views/DemoItem.tsx new file mode 100644 index 0000000..b3979e5 --- /dev/null +++ b/src/frontend/src/views/DemoItem.tsx @@ -0,0 +1,101 @@ +import { useEffect, useState } from 'react'; +import request from '../api/request'; + +// 注意:字段用去前缀名(title/status/id),与 JNPF 后端 Jackson 的 f-前缀剥离一致 +interface DemoItem { + id: string; + title?: string; + status?: string; +} + +export default function DemoItem() { + const [items, setItems] = useState([]); + const [title, setTitle] = useState(''); + + async function load() { + const data = await request.get('/ssw/demo/DemoItem/List'); + setItems(data || []); + } + useEffect(() => { + load(); + }, []); + + async function add() { + if (!title) return; + await request.post('/ssw/demo/DemoItem/Save', { title, status: '草稿' }); + setTitle(''); + load(); + } + async function del(id: string) { + await request.delete(`/ssw/demo/DemoItem/Delete?id=${id}`); + load(); + } + + return ( +
+
+

DemoItem

+
+ setTitle(e.target.value)} + placeholder="标题" + style={input} + /> + +
+
    + {items.map((it) => ( +
  • + + {it.title}({it.status}) + + +
  • + ))} +
+ +
+
+ ); +} + +const wrap: React.CSSProperties = { minHeight: '100vh', padding: 40, background: '#0f1419', color: '#eee' }; +const card: React.CSSProperties = { + display: 'flex', + flexDirection: 'column', + gap: 12, + padding: 24, + background: '#1a1f26', + borderRadius: 12, + minWidth: 360, +}; +const input: React.CSSProperties = { + padding: 8, + borderRadius: 6, + border: '1px solid #333', + background: '#0f1419', + color: '#eee', +}; +const btn: React.CSSProperties = { + padding: 8, + borderRadius: 6, + border: 0, + background: '#185fa5', + color: '#fff', + cursor: 'pointer', +}; +const link: React.CSSProperties = { + padding: 8, + background: 'transparent', + border: 0, + color: '#85b7eb', + cursor: 'pointer', + textAlign: 'left', +}; diff --git a/src/frontend/src/views/Login.tsx b/src/frontend/src/views/Login.tsx new file mode 100644 index 0000000..a578d85 --- /dev/null +++ b/src/frontend/src/views/Login.tsx @@ -0,0 +1,81 @@ +import { useState } from 'react'; +import { useNavigate, useLocation } from 'react-router-dom'; +import { login } from '../api/auth'; +import { setToken } from '../api/request'; +import { encryptPassword } from '../utils/cipher'; + +export default function Login() { + const [account, setAccount] = useState('admin'); + const [password, setPassword] = useState('123456'); + const [err, setErr] = useState(''); + const nav = useNavigate(); + const loc = useLocation(); + + async function onSubmit(e: React.FormEvent) { + e.preventDefault(); + setErr(''); + try { + const hex = encryptPassword(password); + const res = await login(account, hex); + setToken(res.token); + const next = (loc.state as any)?.from?.pathname || '/'; + nav(next); + } catch (e: any) { + setErr(e.message || '登录失败'); + } + } + + return ( +
+
+

SSW JNPF Lite · React

+ setAccount(e.target.value)} placeholder="账号" style={input} /> + setPassword(e.target.value)} + type="password" + placeholder="密码" + style={input} + /> + {err &&
{err}
} + +
默认 admin / 123456
+
+
+ ); +} + +const wrap: React.CSSProperties = { + minHeight: '100vh', + display: 'flex', + alignItems: 'center', + justifyContent: 'center', + background: '#0f1419', + color: '#eee', +}; +const card: React.CSSProperties = { + display: 'flex', + flexDirection: 'column', + gap: 12, + padding: 24, + background: '#1a1f26', + borderRadius: 12, + width: 300, +}; +const input: React.CSSProperties = { + padding: 8, + borderRadius: 6, + border: '1px solid #333', + background: '#0f1419', + color: '#eee', +}; +const btn: React.CSSProperties = { + padding: 10, + borderRadius: 6, + border: 0, + background: '#185fa5', + color: '#fff', + cursor: 'pointer', +}; diff --git a/src/frontend/src/views/MenuManage.tsx b/src/frontend/src/views/MenuManage.tsx new file mode 100644 index 0000000..35f5438 --- /dev/null +++ b/src/frontend/src/views/MenuManage.tsx @@ -0,0 +1,155 @@ +import { useEffect, useState } from 'react'; +import * as api from '../api/sys'; +import { wrap, card, btn, btnDanger, btnGhost, input, tableStyle, th, td } from './ui'; + +export default function MenuManage() { + const [rows, setRows] = useState([]); + const [editing, setEditing] = useState(null); + const [form, setForm] = useState({ + fullName: '', + urlAddress: '', + parentId: '0', + type: 2, + icon: '', + sortCode: 0, + }); + + async function load() { + setRows(await api.listModules()); + } + useEffect(() => { + load(); + }, []); + + const nameOf = (id: string) => + id === '0' ? '(根)' : (rows.find((r) => r.id === id)?.fullName ?? id); + + function openEdit(r?: any) { + if (r) + setForm({ + fullName: r.fullName, + urlAddress: r.urlAddress || '', + parentId: r.parentId || '0', + type: r.type ?? 2, + icon: r.icon || '', + sortCode: r.sortCode ?? 0, + }); + else setForm({ fullName: '', urlAddress: '', parentId: '0', type: 2, icon: '', sortCode: 0 }); + setEditing(r || {}); + } + async function submit() { + if (!form.fullName) return alert('菜单名必填'); + await api.saveModule({ ...form, id: editing?.id }); + setEditing(null); + await load(); + } + async function del(id: string) { + if (!confirm('确认删除该菜单?')) return; + await api.deleteModule(id); + await load(); + } + + return ( +
+
+

菜单管理

+ + + + + + + + + + + + + {rows.map((r) => ( + + + + + + + + ))} + +
名称地址(key)上级排序操作
{r.fullName}{r.urlAddress}{nameOf(r.parentId)}{r.sortCode} + {' '} + +
+ + {editing && ( +
+

{editing.id ? '编辑' : '新增'}菜单

+
+ setForm({ ...form, fullName: e.target.value })} + /> + setForm({ ...form, urlAddress: e.target.value })} + /> + + + setForm({ ...form, icon: e.target.value })} + /> + setForm({ ...form, sortCode: +e.target.value })} + /> +
+
+ + +
+
+ )} +
+
+ ); +} diff --git a/src/frontend/src/views/OrganizeManage.tsx b/src/frontend/src/views/OrganizeManage.tsx new file mode 100644 index 0000000..baf69ef --- /dev/null +++ b/src/frontend/src/views/OrganizeManage.tsx @@ -0,0 +1,112 @@ +import { useEffect, useState } from 'react'; +import * as api from '../api/sys'; +import { wrap, card, btn, btnDanger, btnGhost, input, tableStyle, th, td } from './ui'; + +export default function OrganizeManage() { + const [rows, setRows] = useState([]); + const [editing, setEditing] = useState(null); + const [form, setForm] = useState({ fullName: '', parentId: '0' }); + + async function load() { + setRows(await api.listOrganize()); + } + useEffect(() => { + load(); + }, []); + + const nameOf = (id: string) => + id === '0' ? '(根)' : (rows.find((r) => r.id === id)?.fullName ?? id); + + function openEdit(r?: any) { + if (r) setForm({ fullName: r.fullName, parentId: r.parentId || '0' }); + else setForm({ fullName: '', parentId: '0' }); + setEditing(r || {}); + } + async function submit() { + if (!form.fullName) return alert('机构名必填'); + await api.saveOrganize({ ...form, id: editing?.id }); + setEditing(null); + await load(); + } + async function del(id: string) { + if (!confirm('确认删除该机构?')) return; + try { + await api.deleteOrganize(id); + } catch (e: any) { + return alert(e.message || '删除失败'); + } + await load(); + } + + return ( +
+
+

机构管理

+ + + + + + + + + + + {rows.map((r) => ( + + + + + + ))} + +
名称上级操作
{r.fullName}{nameOf(r.parentId)} + {' '} + +
+ + {editing && ( +
+

{editing.id ? '编辑' : '新增'}机构

+
+ setForm({ ...form, fullName: e.target.value })} + /> + +
+
+ + +
+
+ )} +
+
+ ); +} diff --git a/src/frontend/src/views/Product.tsx b/src/frontend/src/views/Product.tsx new file mode 100644 index 0000000..7029228 --- /dev/null +++ b/src/frontend/src/views/Product.tsx @@ -0,0 +1,93 @@ +import { useEffect, useState } from 'react'; +import { listProducts, saveProduct, deleteProduct } from '../api/product'; +import { wrap, card, btn, btnDanger, input as inputStyle, tableStyle, th, td } from './ui'; + +// 字段用去前缀名:id / title / price(后端 Jackson 会剥掉 f_ 前缀) +interface Product { + id: string; + title?: string; + price?: string; +} + +export default function Product() { + const [items, setItems] = useState([]); + const [title, setTitle] = useState(''); + const [price, setPrice] = useState(''); + + async function load() { + const data = await listProducts(); + setItems(data || []); + } + useEffect(() => { + load(); + }, []); + + async function add() { + if (!title) return; + await saveProduct({ title, price: price || '0.00' }); + setTitle(''); + setPrice(''); + load(); + } + async function del(id: string) { + await deleteProduct(id); + load(); + } + + return ( +
+
+

产品管理

+
+ setTitle(e.target.value)} + placeholder="产品名称" + style={inputStyle} + /> + setPrice(e.target.value)} + placeholder="价格" + style={{ ...inputStyle, width: 100 }} + /> + + +
+ + + + + + + + + + {items.map((it) => ( + + + + + + ))} + {items.length === 0 && ( + + + + )} + +
名称价格操作
{it.title}¥{it.price} + +
+ 暂无数据 +
+
+
+ ); +} diff --git a/src/frontend/src/views/RoleManage.tsx b/src/frontend/src/views/RoleManage.tsx new file mode 100644 index 0000000..d140892 --- /dev/null +++ b/src/frontend/src/views/RoleManage.tsx @@ -0,0 +1,153 @@ +import { useEffect, useState } from 'react'; +import * as api from '../api/sys'; +import { wrap, card, btn, btnDanger, btnGhost, input, tableStyle, th, td } from './ui'; + +export default function RoleManage() { + const [rows, setRows] = useState([]); + const [modules, setModules] = useState([]); + const [editing, setEditing] = useState(null); + const [form, setForm] = useState({ fullName: '', enCode: '', description: '' }); + // 授权面板 + const [authRoleId, setAuthRoleId] = useState(''); + const [checked, setChecked] = useState([]); + + async function load() { + setRows(await api.listRoles()); + setModules(await api.listModules()); + } + useEffect(() => { + load(); + }, []); + + function openEdit(r?: any) { + if (r) setForm({ fullName: r.fullName, enCode: r.enCode || '', description: r.description || '' }); + else setForm({ fullName: '', enCode: '', description: '' }); + setEditing(r || {}); + } + async function submit() { + if (!form.fullName) return alert('角色名必填'); + await api.saveRole({ ...form, id: editing?.id }); + setEditing(null); + await load(); + } + async function del(id: string) { + if (!confirm('确认删除该角色?')) return; + await api.deleteRole(id); + await load(); + } + async function openAuth(roleId: string) { + setAuthRoleId(roleId); + const ids = (await api.roleModules(roleId)) || []; + setChecked(ids); + } + async function saveAuth() { + await api.saveRoleModules(authRoleId, checked); + alert('授权已保存'); + } + + return ( +
+
+

角色管理

+ + + + + + + + + + + {rows.map((r) => ( + + + + + + ))} + +
角色名编码操作
{r.fullName}{r.enCode} + {' '} + {' '} + +
+ + {editing && ( +
+

{editing.id ? '编辑' : '新增'}角色

+
+ setForm({ ...form, fullName: e.target.value })} + /> + setForm({ ...form, enCode: e.target.value })} + /> + setForm({ ...form, description: e.target.value })} + /> +
+
+ + +
+
+ )} + + {authRoleId && ( +
+

角色菜单授权({authRoleId})

+
+ {modules.map((m) => ( + + ))} +
+
+ + +
+
+ )} +
+
+ ); +} diff --git a/src/frontend/src/views/UserManage.tsx b/src/frontend/src/views/UserManage.tsx new file mode 100644 index 0000000..ee379ce --- /dev/null +++ b/src/frontend/src/views/UserManage.tsx @@ -0,0 +1,148 @@ +import { useEffect, useState } from 'react'; +import * as api from '../api/sys'; +import { wrap, card, btn, btnDanger, btnGhost, input, tableStyle, th, td } from './ui'; + +export default function UserManage() { + const [rows, setRows] = useState([]); + const [roleOptions, setRoleOptions] = useState([]); + const [editing, setEditing] = useState(null); + const [form, setForm] = useState({ + account: '', + realName: '', + password: '', + isAdministrator: false, + roleIds: [] as string[], + }); + + async function load() { + setRows(await api.listUsers()); + setRoleOptions(await api.listRoles()); + } + useEffect(() => { + load(); + }, []); + + function openEdit(r?: any) { + if (r) + setForm({ + account: r.account, + realName: r.realName || '', + password: '', + isAdministrator: r.isAdministrator === 1, + roleIds: r.roleIds || [], + }); + else setForm({ account: '', realName: '', password: '', isAdministrator: false, roleIds: [] }); + setEditing(r || {}); + } + async function submit() { + if (!form.account) return alert('账号必填'); + await api.saveUser({ ...form, id: editing?.id }); + setEditing(null); + await load(); + } + async function del(id: string) { + if (!confirm('确认删除该用户?')) return; + await api.deleteUser(id); + await load(); + } + + return ( +
+
+

用户管理

+ + + + + + + + + + + + + {rows.map((r) => ( + + + + + + + + ))} + +
账号姓名角色管理员操作
{r.account}{r.realName}{(r.roleNames || []).join(',')}{r.isAdministrator === 1 ? '是' : '否'} + {' '} + +
+ + {editing && ( +
+

{editing.id ? '编辑' : '新增'}用户

+
+ setForm({ ...form, account: e.target.value })} + /> + setForm({ ...form, realName: e.target.value })} + /> + setForm({ ...form, password: e.target.value })} + /> + + +
+
+ + +
+
+ )} +
+
+ ); +} diff --git a/src/frontend/src/views/ui.ts b/src/frontend/src/views/ui.ts new file mode 100644 index 0000000..d6ff532 --- /dev/null +++ b/src/frontend/src/views/ui.ts @@ -0,0 +1,46 @@ +import { CSSProperties } from 'react'; + +export const wrap: CSSProperties = { + minHeight: '100vh', + padding: 24, + background: '#0f1419', + color: '#eee', + fontFamily: 'system-ui, sans-serif', +}; +export const card: CSSProperties = { + background: '#1a1f26', + borderRadius: 12, + padding: 20, +}; +export const btn: CSSProperties = { + padding: '8px 14px', + borderRadius: 6, + border: 0, + background: '#185fa5', + color: '#fff', + cursor: 'pointer', +}; +export const btnDanger: CSSProperties = { ...btn, background: '#a1322b' }; +export const btnGhost: CSSProperties = { ...btn, background: '#2a3340' }; +export const input: CSSProperties = { + padding: 8, + borderRadius: 6, + border: '1px solid #333', + background: '#0f1419', + color: '#eee', +}; +export const tableStyle: CSSProperties = { + width: '100%', + borderCollapse: 'collapse', + marginTop: 12, +}; +export const th: CSSProperties = { + textAlign: 'left', + padding: '8px', + borderBottom: '1px solid #2a3340', + color: '#9aa7b5', +}; +export const td: CSSProperties = { + padding: '8px', + borderBottom: '1px solid #1f2630', +}; diff --git a/src/frontend/tsconfig.json b/src/frontend/tsconfig.json new file mode 100644 index 0000000..0dd4381 --- /dev/null +++ b/src/frontend/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "target": "ES2020", + "useDefineForClassFields": true, + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "module": "ESNext", + "skipLibCheck": true, + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "react-jsx", + "strict": false, + "noUnusedLocals": false, + "noUnusedParameters": false, + "esModuleInterop": true + }, + "include": ["src"] +} diff --git a/src/frontend/vite.config.ts b/src/frontend/vite.config.ts new file mode 100644 index 0000000..00e729a --- /dev/null +++ b/src/frontend/vite.config.ts @@ -0,0 +1,15 @@ +import { defineConfig } from 'vite'; +import react from '@vitejs/plugin-react'; + +export default defineConfig({ + plugins: [react()], + server: { + host: '127.0.0.1', // macOS 上 vite 默认只 bind ::1 (IPv6),强制 IPv4 避免 127.0.0.1 被 reset + port: 5173, + strictPort: true, // 端口被占直接报错而不是自动换端口(让 perm-smoke 端口断言稳定) + proxy: { + // 所有 /api 请求转发到 NestJS 后端(30010),与 JNPF 网关代理一致 + '/api': 'http://127.0.0.1:30010', + }, + }, +});