From bd2363bf006490d4a75f7af50d77d8337420b018 Mon Sep 17 00:00:00 2001 From: liufumingren Date: Sat, 17 Oct 2026 08:50:32 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E5=88=9D=E5=A7=8B=E5=8C=96=E4=BB=93?= =?UTF-8?q?=E5=BA=93=EF=BC=88backend=20/=20frontend=20/=20extension=20?= =?UTF-8?q?=E4=B8=89=E5=9D=97=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - backend/:Egg 3 纯 JSON 接口服务(MySQL 8 + Redis),全部走 header 令牌鉴权; 已彻底去掉服务端渲染(删除 page 控制器 / app/view / nunjucks / session / CSRF), 开发时把页面请求反代到前端 dev server,生产托管 frontend/dist(SPA 回退)。 单测 91 个通过(不需要本机数据库)。 - frontend/:Vite + Vue3 + TypeScript 的 SPA(登录 / 注册 / 找回密码 / 扫码登录与确认 / 首页统计 / 设备管理 / 扫码记录 / 个人中心 / 测试页),vue-tsc 类型检查与构建通过。 - extension/:MV3 浏览器扩展(零构建),注入第三方 WMS 页面识别运单号并打开溯源页。 - 忽略规则统一放根 .gitignore:node_modules、dist、logs / logs-*、run、typings、 .env*、config.local.js(含本机数据库与 Redis 密码,绝不入库)。 --- .gitattributes | 18 + .gitignore | 50 + README.md | 65 + backend/README.md | 713 ++ backend/app/controller/auth/wechat.js | 169 + backend/app/controller/client/wechat.js | 72 + backend/app/controller/device/auth.js | 237 + backend/app/controller/device/scan.js | 93 + backend/app/controller/device/self.js | 41 + backend/app/controller/health.js | 28 + backend/app/controller/home.js | 18 + backend/app/controller/internal/config.js | 67 + backend/app/controller/internal/device.js | 99 + backend/app/controller/internal/user.js | 108 + backend/app/controller/internal/wechat.js | 95 + backend/app/controller/web/auth.js | 187 + backend/app/controller/web/device.js | 82 + backend/app/controller/web/profile.js | 65 + backend/app/controller/web/record.js | 48 + backend/app/controller/web/stats.js | 44 + backend/app/controller/web/test.js | 111 + backend/app/middleware/api_auth.js | 56 + backend/app/middleware/error_handler.js | 52 + backend/app/middleware/frontend.js | 108 + backend/app/middleware/internal_auth.js | 74 + backend/app/middleware/scanner_auth.js | 32 + backend/app/model/scan_channel.js | 34 + backend/app/model/scan_record.js | 34 + backend/app/model/scanner.js | 42 + backend/app/model/sys_config.js | 30 + backend/app/model/user.js | 38 + backend/app/model/wechat_oauth.js | 40 + backend/app/router.js | 105 + backend/app/service/auth.js | 90 + backend/app/service/cache.js | 87 + backend/app/service/config.js | 131 + backend/app/service/health.js | 31 + backend/app/service/jwt.js | 135 + backend/app/service/mail.js | 89 + backend/app/service/password_reset.js | 126 + backend/app/service/scan.js | 434 + backend/app/service/scanner.js | 271 + backend/app/service/user.js | 194 + backend/app/service/verify_code.js | 116 + backend/app/service/wechat.js | 97 + backend/app/service/wechat_login.js | 499 + backend/config/config.default.js | 206 + backend/config/config.unittest.js | 13 + backend/config/plugin.js | 15 + backend/config/plugin.unittest.js | 19 + backend/jsconfig.json | 5 + backend/package-lock.json | 10162 ++++++++++++++++ backend/package.json | 41 + backend/scripts/db-config.js | 33 + backend/scripts/init-db.js | 54 + backend/scripts/set-password.js | 64 + .../migrations/20261016_add_user_email.sql | 10 + .../migrations/20261016_add_user_password.sql | 7 + .../20261016_devices_to_scanners.sql | 8 + .../sql/migrations/20261016_rebuild_users.sql | 7 + backend/sql/schema.sql | 191 + backend/test/app/controller/config.test.js | 206 + backend/test/app/controller/device.test.js | 389 + backend/test/app/controller/health.test.js | 51 + backend/test/app/controller/home.test.js | 11 + backend/test/app/controller/internal.test.js | 73 + backend/test/app/controller/scan.test.js | 562 + backend/test/app/controller/scanner.test.js | 259 + backend/test/app/controller/user.test.js | 237 + backend/test/app/controller/web.data.test.js | 229 + backend/test/app/controller/web.test.js | 137 + backend/test/app/controller/wechat.test.js | 184 + backend/test/utils/fake-redis.js | 157 + backend/test/utils/internal.js | 15 + extension/README.md | 162 + extension/icons/icon128.png | Bin 0 -> 3114 bytes extension/icons/icon16.png | Bin 0 -> 537 bytes extension/icons/icon32.png | Bin 0 -> 959 bytes extension/icons/icon48.png | Bin 0 -> 1319 bytes extension/manifest.json | 46 + extension/src/background.js | 50 + extension/src/content.css | 92 + extension/src/content.js | 303 + extension/src/lib/rules.js | 596 + extension/src/options.css | 208 + extension/src/options.html | 242 + extension/src/options.js | 383 + extension/src/popup.css | 131 + extension/src/popup.html | 42 + extension/src/popup.js | 155 + extension/test/wms-mock.html | 77 + extension/tools/make-icons.ps1 | 70 + frontend/index.html | 12 + frontend/package-lock.json | 1639 +++ frontend/package.json | 24 + frontend/src/App.vue | 7 + frontend/src/api/client.ts | 75 + frontend/src/api/types.ts | 101 + frontend/src/api/web.ts | 114 + frontend/src/components/AppLayout.vue | 45 + frontend/src/composables/useAuth.ts | 57 + frontend/src/env.d.ts | 7 + frontend/src/main.ts | 6 + frontend/src/router/index.ts | 39 + frontend/src/styles/main.css | 312 + frontend/src/utils/format.ts | 32 + frontend/src/views/DevicesView.vue | 179 + frontend/src/views/ForgotView.vue | 66 + frontend/src/views/HomeView.vue | 107 + frontend/src/views/LoginView.vue | 281 + frontend/src/views/ProfileView.vue | 128 + frontend/src/views/RecordsView.vue | 128 + frontend/src/views/ResetView.vue | 71 + frontend/src/views/TestView.vue | 236 + frontend/src/views/WechatConfirmView.vue | 67 + frontend/tsconfig.json | 24 + frontend/vite.config.ts | 39 + packService.code-workspace | 8 + 118 files changed, 25061 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 README.md create mode 100644 backend/README.md create mode 100644 backend/app/controller/auth/wechat.js create mode 100644 backend/app/controller/client/wechat.js create mode 100644 backend/app/controller/device/auth.js create mode 100644 backend/app/controller/device/scan.js create mode 100644 backend/app/controller/device/self.js create mode 100644 backend/app/controller/health.js create mode 100644 backend/app/controller/home.js create mode 100644 backend/app/controller/internal/config.js create mode 100644 backend/app/controller/internal/device.js create mode 100644 backend/app/controller/internal/user.js create mode 100644 backend/app/controller/internal/wechat.js create mode 100644 backend/app/controller/web/auth.js create mode 100644 backend/app/controller/web/device.js create mode 100644 backend/app/controller/web/profile.js create mode 100644 backend/app/controller/web/record.js create mode 100644 backend/app/controller/web/stats.js create mode 100644 backend/app/controller/web/test.js create mode 100644 backend/app/middleware/api_auth.js create mode 100644 backend/app/middleware/error_handler.js create mode 100644 backend/app/middleware/frontend.js create mode 100644 backend/app/middleware/internal_auth.js create mode 100644 backend/app/middleware/scanner_auth.js create mode 100644 backend/app/model/scan_channel.js create mode 100644 backend/app/model/scan_record.js create mode 100644 backend/app/model/scanner.js create mode 100644 backend/app/model/sys_config.js create mode 100644 backend/app/model/user.js create mode 100644 backend/app/model/wechat_oauth.js create mode 100644 backend/app/router.js create mode 100644 backend/app/service/auth.js create mode 100644 backend/app/service/cache.js create mode 100644 backend/app/service/config.js create mode 100644 backend/app/service/health.js create mode 100644 backend/app/service/jwt.js create mode 100644 backend/app/service/mail.js create mode 100644 backend/app/service/password_reset.js create mode 100644 backend/app/service/scan.js create mode 100644 backend/app/service/scanner.js create mode 100644 backend/app/service/user.js create mode 100644 backend/app/service/verify_code.js create mode 100644 backend/app/service/wechat.js create mode 100644 backend/app/service/wechat_login.js create mode 100644 backend/config/config.default.js create mode 100644 backend/config/config.unittest.js create mode 100644 backend/config/plugin.js create mode 100644 backend/config/plugin.unittest.js create mode 100644 backend/jsconfig.json create mode 100644 backend/package-lock.json create mode 100644 backend/package.json create mode 100644 backend/scripts/db-config.js create mode 100644 backend/scripts/init-db.js create mode 100644 backend/scripts/set-password.js create mode 100644 backend/sql/migrations/20261016_add_user_email.sql create mode 100644 backend/sql/migrations/20261016_add_user_password.sql create mode 100644 backend/sql/migrations/20261016_devices_to_scanners.sql create mode 100644 backend/sql/migrations/20261016_rebuild_users.sql create mode 100644 backend/sql/schema.sql create mode 100644 backend/test/app/controller/config.test.js create mode 100644 backend/test/app/controller/device.test.js create mode 100644 backend/test/app/controller/health.test.js create mode 100644 backend/test/app/controller/home.test.js create mode 100644 backend/test/app/controller/internal.test.js create mode 100644 backend/test/app/controller/scan.test.js create mode 100644 backend/test/app/controller/scanner.test.js create mode 100644 backend/test/app/controller/user.test.js create mode 100644 backend/test/app/controller/web.data.test.js create mode 100644 backend/test/app/controller/web.test.js create mode 100644 backend/test/app/controller/wechat.test.js create mode 100644 backend/test/utils/fake-redis.js create mode 100644 backend/test/utils/internal.js create mode 100644 extension/README.md create mode 100644 extension/icons/icon128.png create mode 100644 extension/icons/icon16.png create mode 100644 extension/icons/icon32.png create mode 100644 extension/icons/icon48.png create mode 100644 extension/manifest.json create mode 100644 extension/src/background.js create mode 100644 extension/src/content.css create mode 100644 extension/src/content.js create mode 100644 extension/src/lib/rules.js create mode 100644 extension/src/options.css create mode 100644 extension/src/options.html create mode 100644 extension/src/options.js create mode 100644 extension/src/popup.css create mode 100644 extension/src/popup.html create mode 100644 extension/src/popup.js create mode 100644 extension/test/wms-mock.html create mode 100644 extension/tools/make-icons.ps1 create mode 100644 frontend/index.html create mode 100644 frontend/package-lock.json create mode 100644 frontend/package.json create mode 100644 frontend/src/App.vue create mode 100644 frontend/src/api/client.ts create mode 100644 frontend/src/api/types.ts create mode 100644 frontend/src/api/web.ts create mode 100644 frontend/src/components/AppLayout.vue create mode 100644 frontend/src/composables/useAuth.ts create mode 100644 frontend/src/env.d.ts create mode 100644 frontend/src/main.ts create mode 100644 frontend/src/router/index.ts create mode 100644 frontend/src/styles/main.css create mode 100644 frontend/src/utils/format.ts create mode 100644 frontend/src/views/DevicesView.vue create mode 100644 frontend/src/views/ForgotView.vue create mode 100644 frontend/src/views/HomeView.vue create mode 100644 frontend/src/views/LoginView.vue create mode 100644 frontend/src/views/ProfileView.vue create mode 100644 frontend/src/views/RecordsView.vue create mode 100644 frontend/src/views/ResetView.vue create mode 100644 frontend/src/views/TestView.vue create mode 100644 frontend/src/views/WechatConfirmView.vue create mode 100644 frontend/tsconfig.json create mode 100644 frontend/vite.config.ts create mode 100644 packService.code-workspace diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..66fd7fd --- /dev/null +++ b/.gitattributes @@ -0,0 +1,18 @@ +# 默认按文本处理并把行尾交给 git 归一化(仓库里存 LF) +* text=auto + +# 脚本按各自平台定行尾 +*.sh text eol=lf +*.ps1 text eol=crlf +*.bat text eol=crlf +*.cmd text eol=crlf + +# 二进制(别做行尾/文本转换) +*.png binary +*.jpg binary +*.jpeg binary +*.gif binary +*.ico binary +*.zip binary +*.apk binary +*.keystore binary diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..81347d0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,50 @@ +# ============================================================ +# 仓库根忽略规则(backend / frontend / extension 通用) +# 只在这一处维护;各子项目不必再各写一份(不带斜杠的规则对任意层级都生效) +# ============================================================ + +# ---------- 依赖 ---------- +node_modules/ +.pnpm-store/ + +# ---------- 构建产物 ---------- +dist/ +build/ +release/ +coverage/ +.nyc_output/ +.vite/ +*.tsbuildinfo + +# ---------- 运行期 / 日志 ---------- +# backend 的 logs/、dev:test 的 logs-test/、脚本产出的 run/ +logs/ +logs-*/ +run/ +tmp/ +*.log +*.pid + +# ---------- 环境变量与本地配置(含数据库/Redis 密码,绝不提交) ---------- +.env +.env.* +!.env.example +config.local.js +config.local.*.js + +# ---------- Egg 自动生成的类型声明(typings/ 由 egg-ts-helper 生成) ---------- +typings/ + +# ---------- 编辑器 / 系统 ---------- +.vscode/* +!.vscode/extensions.json +!.vscode/settings.json +.idea/ +.DS_Store +Thumbs.db +desktop.ini + +# ---------- 临时文件 ---------- +*.tmp +*.bak +* - 副本.* diff --git a/README.md b/README.md new file mode 100644 index 0000000..f533bc8 --- /dev/null +++ b/README.md @@ -0,0 +1,65 @@ +# 云仓视频溯源系统 + +前后端分离 + 一个浏览器扩展,三个目录: + +``` +packService/ +├── backend/ # Egg.js 3(纯 API;MySQL + Redis) +├── frontend/ # Vite + Vue3 + TypeScript(用户端 SPA) +└── extension/ # Chrome MV3 扩展:注入第三方 WMS 页面,把运单号加工成溯源入口 +``` + +## 端口约定(⚠️ 本机项目多,不要用 Vite 默认的 5173) + +| 用途 | 端口 | 启动方式 | +| --- | --- | --- | +| 前端 dev(Vite) | **7301** | `cd frontend && npm run dev` | +| 前端 preview(dist) | **7302** | `cd frontend && npm run preview` | +| 后端 dev | **7001** | `cd backend && npm run dev` | +| 后端 dev:test(与 7001 并存) | **7300** | `cd backend && $env:LOG_DIR='logs-test'; npm run dev:test` | +| 扩展自测页(可选) | **7310** | `npx --yes http-server extension/test -p 7310` | + +- 前端端口可用 `VITE_PORT=7303 npm run dev` 覆盖;`strictPort: true` → 端口被占用时**直接报错**,不会偷偷换端口(否则代理会对不上)。 +- 前端调接口走**同源代理**:Vite 把 `/api`、`/health` 反代到后端(默认 `127.0.0.1:7001`,用 `VITE_BACKEND` 覆盖)。 +- 联调更方便的做法:直接开后端 `:7001`,由后端(dev)把 `/` 反代到前端 dev server(`FRONTEND_DEV_SERVER`,默认 `http://127.0.0.1:7301`)。 +- **上线**:后端托管 `frontend/dist`(静态资源 + SPA fallback),`/` 出前端、`/api/*` 出 JSON。 + +## 身份与通讯约定 + +| 调用方 | 令牌 | 典型接口 | +| --- | --- | --- | +| 前端 SPA(用户端,toC:用户只管自己的设备/记录) | `Authorization: Bearer `(typ=user) | `/api/web/*`(登录/资料/设备/记录) | +| 设备(扫描枪、中控) | `Authorization: Bearer `(typ=scanner) | `/api/device/login`、`/api/scanner/*`、`/api/scan/*` | +| 公开 | 无 | `/api/wechat/{login,status,qrcode.svg}`、`/api/web/auth/*` | + +前端**不用 cookie/session**:令牌存本地、放 header,所以没有跨域 cookie 与 CSRF 的问题 +(JWT 用 `typ` 声明隔离:用户令牌调设备接口一律 401)。 + +## 当前进度 + +- [x] 目录拆分为 `backend/` + `frontend/` +- [x] 前端脚手架(Vite + Vue3 + TS)跑通,登录页走通 `/api/web/auth/*` +- [x] 浏览器扩展 `extension/`(MV3,零构建):注入第三方 WMS 页面识别运单号 → 点击打开溯源页 +- [x] **后端去掉服务端渲染**:删除 `app/controller/page/`、`app/view/`、`app/lib/page.js`、nunjucks / session / CSRF 配置与依赖,后端只剩 JSON 接口 +- [x] 页面全部迁移到前端:登录 / 注册 / 找回密码 / 扫码 / 扫码确认 / 首页统计 / 设备管理 / 扫码记录 / 个人中心 / 测试页 +- [x] 后端 dev 反代前端(`app/middleware/frontend.js`)+ 生产托管 `frontend/dist`(SPA 深链回退) +- [x] 运维接口加鉴权:`app/controller/admin/` → `internal/`,统一挂 `middleware.internalAuth()` +- [x] 新增用户端接口:`/api/web/{stats,devices*,records,test/*}`(范围一律限定在令牌对应的那个用户) +- [ ] 扩展:目标地址换成真实打包视频页(现在指向百度占位)—— 在扩展「设置」里改「目标地址模板」即可,需要真实地址 + +后端接口细节见 [`backend/README.md`](backend/README.md),扩展用法见 [`extension/README.md`](extension/README.md)。 + +## 常用环境变量 + +| 变量 | 默认值 | 作用 | +| --- | --- | --- | +| `PORT` | `7001` | 后端监听端口 | +| `FRONTEND_DEV_SERVER` | `http://127.0.0.1:7301` | 开发时把页面请求反代到哪里 | +| `FRONTEND_DIST` | `frontend/dist` | 生产托管的前端构建产物目录 | +| `FRONTEND_ENABLE` | `true` | 关掉后后端不管页面(纯接口模式) | +| `INTERNAL_TOKEN` | 空 | 运维接口的静态令牌(header `X-Internal-Token`);不配就只能靠白名单账号的 user JWT | +| `INTERNAL_ADMIN_IDS` | `1` | 哪些用户 id 能调运维接口(逗号分隔) | +| `SITE_URL` | 空 | 二维码 / 邮件里链接用的绝对域名(不配则用请求的 host) | +| `VITE_PORT` / `VITE_BACKEND` | `7301` / `http://127.0.0.1:7001` | 前端 dev 端口 / 代理目标 | + +> ⚠️ 运维接口的默认白名单是**内置管理员(id=1)**:上线前请配 `INTERNAL_TOKEN`,或把真正的管理员 id 写进 `INTERNAL_ADMIN_IDS`。 diff --git a/backend/README.md b/backend/README.md new file mode 100644 index 0000000..92ac636 --- /dev/null +++ b/backend/README.md @@ -0,0 +1,713 @@ +# 云仓视频溯源系统(pack-service) + +> 中文名(前端页面/邮件里显示的那个)在 **`config.siteName`** 里,默认「云仓视频溯源系统」,可用环境变量 `SITE_NAME` 覆盖 —— +> 要改名只改这一处(邮件用 `app.config.siteName`)。 +> `pack-service` 只作为**技术标识**保留:npm 包名、JWT `issuer`、日志目录、`egg-scripts --title`。 + +基于 **Egg.js 3** 的**纯接口服务**(⚠️ **不再渲染任何页面**:模板引擎已移除,`/` 这一侧由 +`app/middleware/frontend.js` 反代给前端 dev server 或托管 `../frontend/dist`), +数据库 **MySQL(Sequelize ORM)**,缓存与登录码用 **Redis**。 + +> 页面在隔壁 **`../frontend/`**(Vite + Vue3 + TS SPA);两个服务的端口与启动方式见仓库根目录的 `README.md`。 + +> 业务场景:**设备(扫描枪 / 中控)扫码登录** —— 设备屏幕显示二维码,已登录的手机确认一下; +> 服务端在**确认那一刻**才把设备注册到那个账号名下,并下发**长期 JWT**(默认 1 年,库里存 `jti` 可随时撤销), +> 之后设备调本服务的接口都靠这枚令牌鉴权。**只有这一条身份链路**(没有 sn + secret 那套)。 + +## 环境要求 + +- Node.js >= 18(Egg 3 要求 >= 14.20,建议用 18/20 LTS) +- MySQL 5.7+ / 8.x +- Redis 5+ + +## 目录结构 + +``` +packService/backend +├── app +│ ├── controller # **按「谁在调」分模块**(Egg 支持多级目录 → controller.internal.user) +│ │ ├── home.js # GET /api/info 服务信息(公共) +│ │ ├── health.js # GET /health 健康检查(公共) +│ │ ├── web/ # **用户端(前端 SPA)**:user JWT(typ=user),只能动自己的数据 +│ │ │ ├── auth.js # /api/web/auth/{login,register,register/code,forgot,reset} +│ │ │ ├── profile.js # /api/web/me [/password] 我的资料 / 改密码 +│ │ │ ├── stats.js # /api/web/stats 首页统计(按当前用户) +│ │ │ ├── device.js # /api/web/devices* 我的设备(列表/详情/通道/解绑/删除) +│ │ │ ├── record.js # /api/web/records 我的扫码记录(按自己设备过滤) +│ │ │ └── test.js # /api/web/test/{device-login,scan} 前端测试页的模拟接口 +│ │ ├── internal/ # 运维/内部(❗需内部令牌,挂在 middleware.internalAuth() 后面) +│ │ │ ├── user.js # /api/users* 用户 CRUD(含缓存) +│ │ │ ├── wechat.js # /api/wechat/:appid/:openid、bind、tokens、解绑、用户的授权列表 +│ │ │ ├── config.js # /api/configs* 系统配置读写 +│ │ │ └── device.js # /api/scanners*、/api/scanner/{bind,unbind} 设备列表/详情/解绑/删除 +│ │ ├── auth/ # 公开的登录接口(发码 / 查码 / 微信回调,无需令牌) +│ │ │ └── wechat.js # /api/wechat/{login,status,qrcode.svg,callback} +│ │ ├── client/ # 小程序 / Win 客户端 / SPA(user JWT,typ=user) +│ │ │ └── wechat.js # /api/wechat/confirm +│ │ └── device/ # 设备(长期 JWT,typ=scanner) +│ │ ├── auth.js # /api/device/login 扫码登录+注册(登录即注册,下发长期 JWT) +│ │ ├── self.js # /api/scanner/{me,heartbeat} 自检 / 保活 +│ │ └── scan.js # /api/scan/* 中控上报通道 / 扫码记录(去重) +│ ├── middleware +│ │ ├── api_auth.js # **用户端接口鉴权(只认 header 令牌,不看 cookie/session)** +│ │ ├── internal_auth.js # **运维/内部接口鉴权**(X-Internal-Token 或白名单账号的 user JWT) +│ │ ├── scanner_auth.js # 扫描器 JWT 鉴权(Authorization: Bearer ) +│ │ ├── frontend.js # **前端入口**:dev 反代前端 dev server / 生产托管 frontend/dist(SPA 回退) +│ │ └── error_handler.js # 异常统一成 JSON(4xx 原消息 / 5xx 只回「服务器内部错误」) +│ ├── model +│ │ ├── user.js # users +│ │ ├── wechat_oauth.js # wechat_oauth +│ │ ├── sys_config.js # sys_config +│ │ ├── scanner.js # scanners +│ │ ├── scan_channel.js # scan_channels +│ │ └── scan_record.js # scan_records(去重) +│ ├── service +│ │ ├── auth.js # 登录校验(bcrypt 密码比对)+ 自助注册 +│ │ ├── mail.js # 发邮件(邮箱验证码 / 重置密码链接;开发模式只写日志) +│ │ ├── verify_code.js # 邮箱验证码:生成/发送/校验/消费(Redis 存储 + 重发节流) +│ │ ├── wechat_login.js # 微信扫码登录:二维码本地生成 / 扫码状态机 / code 换 openid +│ │ ├── password_reset.js # 找回密码:重置令牌生成/校验/消费(Redis 存摘要 + 旧链接失效 + 重发节流) +│ │ ├── cache.js # Redis 封装(JSON 序列化 / 过期 / cache-aside / 降级) +│ │ ├── config.js # 配置读写(带 Redis 缓存) +│ │ ├── jwt.js # 令牌签发 / 校验(HS256 + typ + jti,见下文) +│ │ ├── scanner.js # 设备记录:扫码登录即注册 + 绑定/解绑/心跳(只认长期 JWT) +│ │ ├── scan.js # 中控通道上报 / 扫码入库去重 / 扫码查询 +│ │ ├── health.js # MySQL / Redis 连通性探测 +│ │ ├── user.js # 用户数据访问(app.model.User) +│ │ └── wechat.js # 微信授权数据访问 +│ └── router.js +├── config +│ ├── config.default.js # 统一配置(连接 / 端口 / 安全 / 前端入口 / 内部鉴权) +│ ├── config.local.js # 本机密码等(已 gitignore,仅 env=local 加载) +│ ├── config.unittest.js # 单测用的固定内部令牌 +│ ├── plugin.js # 只开 sequelize / redis +│ └── plugin.unittest.js # 单测环境关闭 DB 相关插件 +├── scripts +│ ├── db-config.js # 脚本共用的连接信息解析 +│ ├── init-db.js # 执行 sql 下的 SQL 文件(npm run db:init [file]) +│ └── set-password.js # 创建用户/重置密码(npm run user:pass -- 账号 密码) +├── sql +│ ├── schema.sql # 建表脚本(幂等) +│ └── migrations/ # 一次性数据迁移脚本 +├── test +│ ├── utils/fake-redis.js # 单测用的内存版 Redis +│ └── utils/internal.js # 内部接口鉴权 header(X-Internal-Token) +└── package.json +``` + +## 快速开始 + +```bash +# 1. 安装依赖 +npm install + +# 2. 填写本机连接信息:编辑 config/config.local.js(该文件已被 .gitignore 忽略) +# - mysql.client.password = MySQL(127.0.0.1:3307,账号 packservice) 的密码 +# - redis.client.password / db = Redis 的密码(无密码写 null)与库序号(本机用 1) +# 也可以改用环境变量 MYSQL_PASSWORD / REDIS_PASSWORD / REDIS_DB + +# 3. 建表(库 packservice 需已存在,账号 packservice 仅有该库权限) +npm run db:init +# 如果是旧版本库,按顺序补跑迁移: +# npm run db:init sql/migrations/20261016_rebuild_users.sql # users 表结构重建 +# npm run db:init sql/migrations/20261016_add_user_password.sql # 增加 password_hash +# npm run db:init sql/migrations/20261016_devices_to_scanners.sql # 删掉旧的 devices 表(改用 scanners) +# npm run db:init sql/migrations/20261016_add_user_email.sql # users 增加 email(可当登录账号) + +# 4. 建一个登录账号(不存在会直接创建,密码 bcrypt 入库) +npm run user:pass -- admin 123456 管理员 + +# 5. 启动(默认 http://127.0.0.1:7001) +# 登录页:http://127.0.0.1:7001/login(用上面的账号登录) +npm run dev + +# 本地测试想要一个“专用端口”(默认 7300,可与 npm run dev 同时开): +npm run dev:test +# → http://127.0.0.1:7300 ;想换端口:egg-bin dev --port 7400,或 $env:PORT=7400; npm run dev +# 两实例并存时给测试实例单独日志目录:$env:LOG_DIR='logs-test'; npm run dev:test + +# 生产模式 +npm start # egg-scripts 后台启动 +npm stop +``` + +验证: + +```bash +curl -I http://127.0.0.1:7001/login # 200:反代到前端 dev server(前端没起则 502 提示页) +curl http://127.0.0.1:7001/health +curl http://127.0.0.1:7001/api/users # 401:内部接口要令牌(X-Internal-Token 或管理员 user JWT) +curl -H 'X-Internal-Token: ' http://127.0.0.1:7001/api/users # 200 +``` + +> 后端只管接口:页面在 `../frontend/`(`npm run dev` 起在 7301)。 +> 联调推荐**只开后端地址** `http://127.0.0.1:7001`(dev 环境自动把页面请求反代给前端);也可以直接开前端 7301(Vite 把 `/api` 反代到 7001)。 + +## 单元测试 + +```bash +npm test # 无需本机启动 MySQL / Redis +npm run cov +``` + +### 本地专用测试端口(`npm run dev:test`) + +- `npm run dev:test` = `egg-bin dev --port 7300`(可与 7001 的 `npm run dev` 同时跑);端口也可用环境变量 `PORT` 覆盖(egg-cluster 会读 `process.env.PORT`),`config.cluster.listen.port` 的默认值是 `Number(PORT || 7001)`; +- **登录态是共享的**:cookie(`packs_sess`)不带端口,`127.0.0.1:7001` 的登录 cookie 在 `127.0.0.1:7300` 一样有效,换端口不用重新登录;两个实例也共用同一套 MySQL / Redis(都读 `config/config.local.js`); +- **扫码二维码地址会自动跟随端口**:二维码内容是 `ctx.origin` 拼的 `http://<当前访问的 host:port>/wechat?spm=1.0.<码>.1`,所以在 7300 打开的登录页,扫出来的就是 7300 的地址,不用改配置;邮件里的重置链接同理(`config.email.siteUrl || ctx.origin`),只有显式配了 `SITE_URL` 才需要跟着改; +- 两个实例并存时日志默认都写 `logs/pack-service/`,想分开就 `$env:LOG_DIR='logs-test'; npm run dev:test`(PowerShell)/ `LOG_DIR=logs-test npm run dev:test`(bash); +- `npm test` 是单测(不监听固定端口),和这两个端口不冲突; + +- `config/plugin.unittest.js` 在测试环境关闭 `sequelize` 与 `redis` 插件(这两个插件在启动时都会连库); +- 测试中用 `mock(app, 'model', fakeModel)` / `mock(app, 'redis', fakeRedis)` 注入假实现,因此 CI 上不依赖外部服务。 + +## 环境变量 + +不配置时使用默认值(`127.0.0.1:3307` / 账号 `packservice` / 库名 `packservice`,密码为空需在 `config/config.local.js` 填)。 + +| 变量 | 默认值 | 说明 | +| --- | --- | --- | +| `MYSQL_HOST` | `127.0.0.1` | MySQL 地址 | +| `MYSQL_PORT` | `3307` | MySQL 端口 | +| `MYSQL_USER` | `packservice` | 用户名(**大小写敏感**) | +| `MYSQL_PASSWORD` | 空 | 密码,本地放 `config/config.local.js` | +| `MYSQL_DATABASE` | `packservice` | 库名 | +| `MYSQL_POOL_SIZE` | `10` | Sequelize 连接池上限(`pool.max`) | +| `REDIS_HOST` | `127.0.0.1` | Redis 地址 | +| `REDIS_PORT` | `6379` | Redis 端口 | +| `REDIS_PASSWORD` | 空(`null`) | 密码,无密码时必须为空 | +| `REDIS_DB` | `0` | 库序号 | +| `CACHE_PREFIX` | `packs:` | 业务缓存 key 前缀 | +| `CACHE_TTL` | `300` | 默认缓存过期(秒) | +| `JWT_SECRET` | 开发默认值 | 扫描器 JWT 签名密钥,**生产未设置会启动失败** | +| `SITE_NAME` | `云仓视频溯源系统` | 站点/产品中文名(页面标题、侧边栏品牌、邮件主题与正文都用它) | +| `SCANNER_JWT_EXPIRES` | `365d` | 扫描器长期 JWT 默认有效期(`jsonwebtoken` 语法,如 `30d` / `720h`) | +| `DEVICE_JWT_EXPIRES` | 同 `SCANNER_JWT_EXPIRES` | `/api/device/login` 下发令牌的**默认时长 + 上限**;设备可用 `?expiresIn=30d` 申请更短的,不能更长 | +| `REGISTER_ENABLED` | `true` | 是否允许登录页自助注册(`false`/`0`/`no`/`off` 关闭;**生产建议关掉**,用 `npm run user:pass` 建号) | +| `SMTP_HOST` | 空 | SMTP 主机;**不配就走开发模式**(验证码只写日志 + 注册页回显,不发真邮件) | +| `SMTP_PORT` | `465` | SMTP 端口 | +| `SMTP_SECURE` | `true` | 是否用 TLS(465 用 true,587 用 false) | +| `SMTP_USER` / `SMTP_PASSWORD` | 空 | SMTP 账号密码(放 `config/config.local.js` 或环境变量) | +| `SMTP_FROM` | `云仓视频溯源系统 ` | 发件人(默认取 `SITE_NAME` 作显示名) | +| `EMAIL_CODE_TTL` | `600` | 邮箱验证码有效期(秒) | +| `EMAIL_CODE_RESEND` | `60` | 同一邮箱重发验证码的间隔(秒) | +| `EMAIL_CODE_ATTEMPTS` | `5` | 同一个验证码最多校验几次(超过则作废) | +| `EMAIL_RESET_TTL` | `1800` | 重置密码链接有效期(秒,默认 30 分钟) | +| `SITE_URL` | 空 | 邮件里重置链接的站点地址(如 `https://packs.example.com`);不配则用当前请求的 host | +| `WECHAT_APPID` | 空 | 微信开放平台网站应用 appid;**不配时登录页二维码退化为本地演示码**(不会假装能用) | +| `WECHAT_SECRET` | 空 | 同上对应的 appsecret | +| `WECHAT_REDIRECT_URI` | 空 | 扫码回调地址(需与开放平台后台配置一致);不配则按当前请求 origin 拼 `/login/wechat/callback` | +| `WECHAT_API_BASE` | `https://api.weixin.qq.com` | 微信接口域名(自建网关/联调时可改) | +| `WECHAT_QR_CELL` / `WECHAT_QR_MARGIN` | `6` / `4` | 二维码 SVG 的单元格像素 / 静默区格数(⚠️ 库的 margin 参数单位是像素,代码里已按格×单元格换算;<4 格会影响扫码) | +| `WECHAT_STATE_TTL` | `600` | 扫码串码(二维码)有效期(秒) | +| `WECHAT_CODE_LENGTH` | `6` | 扫码串码长度(数字 + 大写字母,去掉了 0/O/1/I 等易混字符) | +| `WECHAT_SPM_PATTERN` | `1.0.{code}.1` | 二维码地址里的 spm 格式(`{code}` 会被替换成串码) | +| `USER_JWT_EXPIRES` | `7d` | 扫码登录接口下发的**用户 JWT** 有效期 | +| `WECHAT_POLL_WAIT` | `60` | 扫码登录接口长轮询最多挂起多少秒(前端自己的超时建议再 +10s;反代注意 `proxy_read_timeout` 要大于它) | + +Windows PowerShell 示例: + +```powershell +$env:MYSQL_PASSWORD = 'your-pass'; $env:REDIS_PASSWORD = 'your-pass'; npm run dev +``` + +## 数据表 + +六张表统一约定:`BIGINT UNSIGNED` 自增主键、`created_at` / `updated_at`、`deleted_at`(软删除,Sequelize `paranoid: true`)、`status` 状态位。 + +### users 用户表 + +| 字段 | 类型 | 说明 | +| --- | --- | --- | +| id | bigint unsigned | 主键 | +| username | varchar(64) | 登录名,唯一,可空(纯微信登录可不设) | +| nickname | varchar(64) | 昵称 | +| email | varchar(128) | 邮箱,**唯一、可空**;注册可选填,**可当登录账号**(入库统一转小写) | +| avatar | varchar(255) | 头像 | +| phone | varchar(20) | 手机号,唯一 | +| gender | tinyint unsigned | 0 未知 / 1 男 / 2 女 | +| status | tinyint unsigned | 1 正常 / 0 禁用 | +| remark | varchar(255) | 备注 | +| last_login_at | datetime | 最近登录时间 | +| created_at / updated_at / deleted_at | datetime | 时间戳与软删除 | + +### wechat_oauth 微信授权表 + +一条记录 = 某用户在某 `appid` 下的一次授权,**一个用户可绑定多个微信**。 + +| 字段 | 类型 | 说明 | +| --- | --- | --- | +| id | bigint unsigned | 主键 | +| user_id | bigint unsigned | 关联 `users.id` | +| appid | varchar(64) | 微信 appid,与 openid 组成唯一键 | +| openid | varchar(64) | 用户在该 appid 下的 openid | +| unionid | varchar(64) | 开放平台 unionid | +| nickname / avatar | varchar | 授权时的微信资料 | +| session_key | varchar(128) | 小程序 session_key | +| access_token / refresh_token | varchar(512) | 网页授权令牌 | +| scope | varchar(64) | 授权 scope | +| token_expires_at | datetime | access_token 过期时间 | +| last_auth_at | datetime | 最近授权时间 | +| created_at / updated_at / deleted_at | datetime | 时间戳与软删除 | + +### sys_config 系统配置表 + +`group_name` + `config_key` 唯一定位一条配置,`value_type` 决定 `config_value` 的解析方式(`string` / `number` / `boolean` / `json`)。 + +> 注意:本表用软删除,若建唯一索引会被已删除的记录占用,导致同 key 无法重建,因此**唯一性由 service 层保证**(先查后写),表上只建普通索引。 + +### scanners 设备表 + +设备(条码/二维码扫描枪、中控)**扫码登录时自动注册**,`user_id` 为空表示尚未绑定账号 +(设备归哪个账号由「扫码确认」的人决定,也可由管理员解绑)。 + +| 字段 | 类型 | 说明 | +| --- | --- | --- | +| id | bigint unsigned | 主键 | +| user_id | bigint unsigned | 绑定的用户 id,未绑定为 NULL | +| sn | varchar(64) | 设备 SN,唯一(设备唯一标识;设备不传时由服务端生成 `DEV-…`) | +| name / model / vendor / firmware | varchar | 名称、型号、厂商、固件/客户端版本 | +| ip | varchar(45) | 最近登录 IP | +| secret_hash | varchar(100) | **历史字段**(早期 sn+secret 登录用),现已不再写入 | +| token_jti | varchar(64) | 当前长期 JWT 的 `jti`,唯一;**库里不存令牌本体** | +| token_expires_at | datetime | 令牌过期时间(默认 365 天) | +| status | tinyint unsigned | 1 正常 / 0 禁用(禁用后登录与所有带令牌的接口都 403) | +| last_register_at / last_login_at / last_seen_at | datetime | 最近注册、最近登录、最近心跳时间 | +| created_at / updated_at / deleted_at | datetime | 时间戳与软删除 | + +设备接入流程(**只有一条链路**): + +1. **拿令牌(也就是注册)**:`GET /api/device/login`(公开,无需任何凭据): + - ① 不带参数 → 返回登录码 + 二维码地址(`qrContent` / `qrImageUrl`),**此时库里还没有任何记录**; + - ② 手机用 `POST /api/wechat/confirm` 确认(已登录用户); + - ③ 设备带 `?code=&wait=60` 长轮询 → **这一边才注册**:按 SN 建/取记录、绑定到确认登录的账号,并拿到长期 JWT; +2. **用令牌**:之后所有请求带 `Authorization: Bearer `;`GET /api/scanner/me` 自检、`POST /api/scanner/heartbeat` 保活(刷新 `last_seen_at`)、`/api/scan/*` 上报; +3. **令牌到期 / 设备重装**:再扫一次码即可(不需要密钥:设备屏幕出码、人确认一下)—— 记录已存在时不重复建,只换发新令牌; +4. **换人使用(设备转让)**:先由原账号在 `/scanners` 解绑(或管理侧 `POST /api/scanner/unbind`),新使用人再扫码登录即可认领; +5. SN 曾经被**删除**过也能继续用同一个 SN:扫码登录会把那条**软删除**的记录**复活**(id 不变、`deleted_at` 清空)—— 软删行仍占着 `sn` 唯一键,不复活就会撞键。 + +> 历史变更:早期的 `POST /api/scanner/register`(自己注册拿 sn+secret)与 `POST /api/scanner/login`(sn+secret 换令牌) +> **已下线**(跟扫码登录重复,而且会先建出一条 `user_id = NULL` 的无主记录);设备身份现在**只有长期 JWT 一种**。 + +#### 设备通讯用的长期 JWT + +- 算法 HS256,`issuer = pack-service`、`audience = scanner`,payload 含 `sub`(设备 id)/ `sn` / `typ: 'scanner'` / `jti`; +- 有效期:默认 **365 天**(`config.jwt.deviceExpiresIn`,env `DEVICE_JWT_EXPIRES`,不配就跟 `SCANNER_JWT_EXPIRES` 走);设备可用 `?expiresIn=30d`(或秒数)申请**更短**的,超上限 422; +- **可撤销**:每次扫码登录都会生成新的 `jti` 写库(`scanners.token_jti`),旧令牌因 `jti` 不匹配立即 401;把 `status` 置 0 也可让令牌失效(403); +- 令牌本体不落库(只存 `jti`);列表/详情/`me` 等响应都不返回 `token_jti`(`app/service/scanner.js` 的 `sanitize()` 兜底清洗); +- 签名密钥取 `config.jwt.secret`(来自 `JWT_SECRET`),生产环境未设置会直接启动失败。 + +令牌取用顺序:`Authorization: Bearer ` → `X-Scanner-Token` → `?access_token=`(见 `app/middleware/scanner_auth.js`)。 + +### scan_channels 扫描中控通道表 + +「中控」就是绑定端(复用 `scanners`,用自己的 `sn` + 长期 JWT 上报):一台中控可接多个扫码设备, +每个扫码设备对应一个通道,中控把 **通道 id + 通道名** 上报上来,**一个通道一行**。 + +| 字段 | 类型 | 说明 | +| --- | --- | --- | +| id | bigint unsigned | 主键 | +| scanner_id | bigint unsigned | 上报的中控(= `scanners.id`) | +| channel_id | varchar(64) | 通道 id(中控上报,**同一中控内唯一**) | +| channel_name | varchar(128) | 通道名(中控上报) | +| last_report_at | datetime | 最近一次上报时间 | +| status | tinyint unsigned | 1 正常 / 0 停用 | +| created_at / updated_at / deleted_at | datetime | 时间戳与软删除 | + +- 唯一键 `(scanner_id, channel_id)`:同一中控重复上报同一个通道 = 更新通道名与 `last_report_at`,不会重复建行; +- 因为 `channel_id` 只在同一中控内唯一,所以关联/去重都必须带上 `scanner_id`; +- 用软删除:曾被停用(`deleted_at` 非空)的通道再次上报时会自动「复活」。 + +### scan_records 扫码记录表 + +中控上报的扫码流水:**条码 + 扫描时间 + 通道 id**,需要**去重存储**。 + +| 字段 | 类型 | 说明 | +| --- | --- | --- | +| id | bigint unsigned | 主键 | +| scanner_id | bigint unsigned | 上报的中控(= `scanners.id`) | +| channel_id | varchar(64) | 通道 id | +| barcode | varchar(255) | 条码内容 | +| scan_time | datetime | 扫描时间(中控上报,**精确到秒**,去重键之一) | +| reported_at | datetime | 服务端接收时间 | +| created_at / updated_at | datetime | 时间戳 | + +去重规则(唯一键 `uk_scan_dedup` = `(scanner_id, channel_id, barcode, scan_time)`): + +- **同一中控 + 同一通道 + 同一条码 + 同一扫描时间(秒)** 只入库一次,重复上报不会报错,接口返回 `duplicated` 计数; +- 上报前先用一次查询(按中控 + 通道 + 时间范围)捞出已存在的记录做过滤,剩下的批量插入; + 真出现并发撞唯一键时会自动退化成逐条插入,撞上的计入 `duplicated`; +- 同一批里完全相同的上报也只留一条(内存里先去重); +- 条码相同但时间或通道不同 → 视为两条不同记录; +- 时间精度到秒:`scan_time` 会先把毫秒截断,再做去重与入库(同一秒内的同条码算重复)。 + +> 本表**不用软删除**(paranoid 关闭):软删除会让记录占用唯一键,导致同一条扫码数据再也无法入库; +> 需要清理请按时间物理删除:`DELETE FROM scan_records WHERE scan_time < ?`。 + +## 页面(在前端项目里) + +⚠️ **后端不再渲染页面**:`app/view/`、nunjucks、session、CSRF 都已移除,`app/controller/page/` 也删掉了。 +登录 / 注册 / 找回密码 / 扫码确认 / 首页 / 设备管理 / 扫码记录 / 个人中心 / 测试页 +全都在 **`../frontend/`**(Vite + Vue3 + TS 的 SPA)里,通过下面的 JSON 接口通讯: + +| 页面 | 前端路由 | 用到的接口 | +| --- | --- | --- | +| 登录 / 注册 / 扫码 | `/login` | `/api/web/auth/*`、`/api/wechat/{login,status,qrcode.svg}` | +| 手机确认登录 | `/wechat?spm=…` | `/api/wechat/confirm` | +| 忘记 / 重置密码 | `/forgot`、`/reset` | `/api/web/auth/{forgot,reset}` | +| 首页统计 | `/` | `/api/web/stats` | +| 设备管理 | `/devices` | `/api/web/devices*` | +| 扫码记录 | `/records` | `/api/web/records` | +| 个人中心 | `/profile` | `/api/web/me*` | +| 测试页 | `/test` | `/api/web/test/*`、`/api/wechat/{status,confirm}` | + +**后端怎么把页面交出去**(`app/middleware/frontend.js`,只接管「非 `/api`、`/health`」的 GET/HEAD 请求): + +- **开发**(`env=local`):**反代**到 `FRONTEND_DEV_SERVER`(默认 `http://127.0.0.1:7301`,即 `frontend/ && npm run dev`), + 包含 HMR 的 WebSocket 升级 —— 所以联调只开 `http://127.0.0.1:7001` 一个地址就够(前端热更新照常生效); + 前端没起来时会回一个 502 提示页,而不是白屏; +- **生产**:托管 `FRONTEND_DIST`(默认 `../frontend/dist`);找不到文件且请求要 HTML 时回退 `index.html` + (SPA 深链 `/devices` 刷新不会 404);dist 不存在时回 503 并提示先 `npm run build`; +- **单测**(`env=unittest`):整个中间件跳过(不连前端、也不要求 dist 存在)。 + +## 接口 + + +### 按调用方分模块(目录 / 鉴权 / 路径 一一对应) + +| 调用方 | 控制器目录 | 鉴权 | 典型接口 | +| --- | --- | --- | --- | +| **用户端(前端 SPA)** | `app/controller/web/` | `middleware.apiAuth()`(**user JWT**,typ=user);登录/注册/找回免令牌 | `/api/web/{auth/*,me*,stats,devices*,records,test/*}` | +| **运维 / 内部**(运维脚本、后台系统) | `app/controller/internal/` | `middleware.internalAuth()`(`X-Internal-Token` 或白名单账号的 user JWT) | `/api/users*`、`/api/configs*`、`/api/scanners*`、`/api/scanner/{bind,unbind}`、`/api/wechat/{bind,:id/tokens}` | +| **用户态**(小程序 / Win 客户端) | `app/controller/client/` | `middleware.apiAuth()`(**user JWT**,typ=user) | `/api/wechat/confirm` | +| **设备**(扫描枪 / 中控) | `app/controller/device/` | `middleware.scannerAuth()`(**device JWT**,typ=scanner) | `/api/device/login`、`/api/scanner/{me,heartbeat}`、`/api/scan/*` | +| **公开登录接口** | `app/controller/auth/` | 无 | `/api/wechat/{login,status,qrcode.svg,callback}`(`/api/device/login` 的发码也无需凭据) | +| 公共 | `home.js` / `health.js` | 无 | `/api/info`、`/health` | + +- **小程序与 Win 客户端共用 `client/` 那一套**:它们身份相同(都是「某个登录用户」),业务接口不该复制两份;要区分用途用 header(如 `X-Client: miniapp|win`)或令牌里的自定义声明,别用路径分叉。 +- **令牌层是硬隔离**:`verifyUser()` 只认 `typ: 'user'`(默认 7d),`verifyScanner()` 只认 `typ: 'scanner'`(默认 365d)——用户令牌调设备接口、设备令牌调用户接口都直接 401。 + (⚠️ 两个 `verify*` 都必须比对 `typ`:用户令牌与设备令牌用的是同一把密钥,不比对的话用户令牌就能当设备令牌用。) +- **前端只能碰自己的数据**:`/api/web/devices*`、`/api/web/records`、`/api/web/stats` 的过滤条件一律取令牌里的 `userId`,前端传的 `userId`/`deviceId` 越权一概 404(不泄露别人有没有这台设备)。 +- **服务层不按调用方分**:`app/service/` 按**领域**拆文件(`scanner` / `scan` / `user` / `config` / `wechat` / `wechat_login` / `jwt` / `cache` / `mail` / `verify_code` / `password_reset`),因为设备与内部接口会共用同一个领域服务(如 `service.scanner` 既被 `device/*` 也被 `internal/device.js` 调用);`app/model/` 按表拆。 +- Egg 支持多级目录:`app/controller/internal/user.js` → `controller.internal.user`(路由里就是这么引用的),`typings/` 会自动重新生成。 + +| 方法 | 路径 | 说明 | +| --- | --- | --- | +| GET | `/api/info` | 服务信息(JSON) | +| GET | `/health` | 健康检查,MySQL 或 Redis 不可用时返回 503 | +| GET | `/api/users?page=1&pageSize=20&keyword=&status=` | 用户分页(keyword 模糊匹配昵称/登录名/手机号) | +| GET | `/api/users/:id` | 用户详情(Redis 缓存 → 回源数据库) | +| POST | `/api/users` | 新增,body: `{"username":"zhangsan","nickname":"张三","phone":"13800000000"}` | +| PUT | `/api/users/:id` | 更新(清除该用户缓存) | +| DELETE | `/api/users/:id` | 软删除(清除该用户缓存) | +| GET | `/api/users/:id/wechats` | 某用户的全部微信授权 | +| GET | `/api/wechat/:appid/:openid` | 按 appid + openid 反查授权与关联用户 | +| POST | `/api/wechat/bind` | 绑定/更新授权,body: `{"userId":1,"appid":"wx123","openid":"o_abc"}` | +| PUT | `/api/wechat/:id/tokens` | 更新 session_key / 令牌,body: `{"sessionKey":"sk","expiresIn":7200}` | +| DELETE | `/api/wechat/:id` | 解绑(软删除) | +| GET | `/api/configs?group=wechat` | 配置列表(管理用,含禁用项) | +| GET | `/api/configs/:group/:key` | 取单个配置值(带 Redis 缓存) | +| GET | `/api/configs/:group` | 取分组内所有启用配置 | +| PUT | `/api/configs` | 新增/更新(幂等),body: `{"groupName":"wechat","configKey":"appid","configValue":"wx123"}` | +| DELETE | `/api/configs/:group/:key` | 软删除(清缓存) | +| GET | `/api/device/login` | **设备「扫码登录 + 注册」**(参考 `/api/wechat/login`,但下发**长期** JWT):**不需要凭据、不需要预先注册**(公开接口);`?sn=`/`name`/`vendor`/`model`/`firmware` 可选(发码时带上最省事,服务端会暂存)、`?expiresIn=30d` 可选(只能比服务端上限短);不带 `code` → 发登录码(`code` / `spm` / **`qrContent`(二维码要编的完整网址)** / `qrImageUrl`(完整地址的 SVG));带 `?code=&wait=N` → 长轮询,手机用 `POST /api/wechat/confirm` 确认后**立即**返回 `{ firstTime, sn, token, expiresIn, expiresAt, scanner, user }`,**注册/绑定就发生在这一刻**(SN 已属于别人 → 403) | +| POST | `/api/scanner/bind` | **管理侧**:把设备绑定到账号,body: `{ sn, username }` 或 `{ sn, userId }` | +| POST | `/api/scanner/unbind` | **管理侧**:解绑,body: `{ sn }`(设备可再扫码重新认领) | +| GET | `/api/scanner/me` | **需 JWT**:返回当前设备信息(自检连通性) | +| POST | `/api/scanner/heartbeat` | **需 JWT**:保活,刷新 `last_seen_at` 并返回服务端时间 | +| GET | `/api/scanners?page=&pageSize=&keyword=&userId=&status=` | 设备列表(带绑定账号;管理侧) | +| GET | `/api/scanners/:id` | 扫描器详情 | +| DELETE | `/api/scanners/:id` | 软删除扫描器 | +| POST | `/api/scan/channels` | **需扫描器 JWT**:中控上报通道,body: `{ channels: [{ channelId, channelName }] }`(单条也可)→ `{ created, updated, invalid, errors }` | +| GET | `/api/scan/channels?page=&pageSize=&keyword=&status=` | **需扫描器 JWT**:当前中控已登记的通道 | +| POST | `/api/scan/records` | **需扫描器 JWT**:中控上报扫码,body: `{ records: [{ barcode, scanTime, channelId }] }` → `{ received, inserted, duplicated, invalid, unknownChannels }` | +| GET | `/api/scan/records?page=&pageSize=&channelId=&barcode=&startTime=&endTime=` | **需扫描器 JWT**:当前中控上报的扫码记录 | + +扫码上报的两个接口都**不会因为重复而报错**(幂等):重复条数计入 `duplicated`; +单条非法(缺条码 / 时间非法 / 超长)会被跳过并计入 `invalid` + `errors`;整体为空数组才返回 422。 +上报还支持 `records` 传 JSON 字符串(部分设备端会这么塞);上报成功会顺手刷新中控心跳与通道的 `last_report_at`, +遇到未登记的通道会自动补建一行(`channel_name` 留空,同时记 WARN 日志)。 + +统一响应格式:成功 `{ "ok": true, "data": ... }`;失败 `{ "ok": false, "message": "..." }`(由 `app/middleware/error_handler.js` 保证 4xx/5xx 也返回 JSON); +**接口路径写错(没匹配到路由)也是 JSON**:`404 { ok:false, message:'接口不存在' }`(不会再返 HTML 404 页把客户端的 JSON 解析弄挂)。 + +扫描器 JWT 鉴权结果:缺令牌 / 签名不对 / 已过期 / `jti` 已被轮换 / 扫描器不存在 → **401**;扫描器被禁用 → **403**。 + +## 用法速查 + +```js +// ===== MySQL:Sequelize 模型(定义在 app/model/*.js)===== +// 通过 app.model.User / this.app.model.User / ctx.model.User 访问 +const { User, WechatOauth, SysConfig } = this.app.model; + +await User.findByPk(1); // 主键查询 +await User.findOne({ where: { username: 'zhangsan' } }); +await User.findAll({ where: { status: 1 }, limit: 10, offset: 0, order: [[ 'id', 'DESC' ]] }); +const { rows, count } = await User.findAndCountAll({ limit: 10 }); // 分页 +await User.create({ username: 'zhangsan', nickname: '张三' }); // 新增(自动写 created_at/updated_at) +await User.update({ status: 0 }, { where: { id: 1 } }); // 更新 +await User.destroy({ where: { id: 1 } }); // 删除(paranoid 模型 = 软删除) +await User.destroy({ where: { id: 1 }, force: true }); // 物理删除 + +// 关联查询:一个用户的多条微信授权 +const withWechats = await User.findOne({ where: { id: 1 }, include: [{ model: WechatOauth, as: 'wechats' }] }); + +// 原生 SQL / 事务 +const [rows2] = await this.app.model.query('SELECT 1 AS ok'); +await this.app.model.transaction(async t => { + await User.create({ nickname: 'a' }, { transaction: t }); + await User.create({ nickname: 'b' }, { transaction: t }); +}); + +// 操作符:const { Op } = require('sequelize'); + +// ===== 系统配置:带 Redis 缓存,写入自动失效 ===== +const appid = await this.ctx.service.config.get('wechat', 'appid'); // value_type=number/json/boolean 会自动转换 +await this.ctx.service.config.set({ groupName: 'wechat', configKey: 'appid', configValue: 'wx123' }); +const groupConfig = await this.ctx.service.config.getGroup('wechat'); // { appid: 'wx123', ... } +await this.ctx.service.config.remove('wechat', 'appid'); // 软删除 + 清缓存 + +// ===== 微信授权 ===== +await this.ctx.service.wechat.bind({ userId: 1, appid: 'wx123', openid: 'o_abc', nickname: '微信昵称' }); +const oauth = await this.ctx.service.wechat.findByOpenid('wx123', 'o_abc'); // 带关联用户 +const user = await this.ctx.service.user.findByOpenid('wx123', 'o_abc'); // 直接拿用户 + +// ===== 扫描器长期 JWT(app/service/jwt.js)===== +const jwtToken = this.ctx.service.jwt.signScanner(scanner, { jti: 'uuid' }); // 签发 +this.ctx.service.jwt.verifyScanner(jwtToken); // 校验(失败直接 401) +this.ctx.service.jwt.expiresAtOf(jwtToken); // 取过期时间(Date) + +// ===== 设备业务(app/service/scanner.js)===== +// 扫码登录(注册 + 绑定 + 发令牌,一步到位;userId = 扫码确认的那个人) +const login = await this.ctx.service.scanner.loginByScan({ + sn: 'SN-001', // 设备自报的 SN(不传则服务端生成 DEV-…) + name: '1 号线扫描枪', + userId: 1, // 来自 POST /api/wechat/confirm 的确认人 + expiresIn: undefined, // 可选:秒数;不传用 config.jwt.deviceExpiresIn +}); +login.token; // 长期 JWT(365d) +login.firstTime; // true = 本次才注册出这条记录 +await this.ctx.service.scanner.heartbeat(scanner, this.ctx.ip); // 心跳:刷新 last_seen_at +await this.ctx.service.scanner.unbind({ sn: 'SN-001' }); // 管理侧解绑 + +// ===== 扫码信息(app/service/scan.js,scanner = 中控实例)===== +// 1. 中控上报通道(一个通道一行,重复上报只更新通道名) +await this.ctx.service.scan.reportChannels(scanner, [ + { channelId: 'CH-1', channelName: '1 号打包口' }, +]); +// → { received, created, updated, invalid, errors, channels } + +// 2. 中控上报扫码结果(同一中控+通道+条码+扫描时间(秒) 自动去重) +const ingested = await this.ctx.service.scan.ingest(scanner, [ + { barcode: '6901234567890', scanTime: '2026-10-16 10:20:30', channelId: 'CH-1' }, + { barcode: '6901234567890', scanTime: '2026-10-16 10:20:30', channelId: 'CH-1' }, // 重复 → 只入库一次 +]); +// → { received: 2, inserted: 1, duplicated: 1, invalid: 0, unknownChannels: [] } + +// 3. 查询(都带分页;记录默认按 scan_time 倒序) +await this.ctx.service.scan.listChannels({ scannerId: scanner.id, keyword: '' }); +await this.ctx.service.scan.listRecords({ scannerId: scanner.id, channelId: 'CH-1', barcode: '690' , startTime: '2026-10-16', endTime: '2026-10-17' }); + +// 时间解析:'2026-10-16 10:20:30' / '2026-10-16T10:20:30' / 10 位秒时间戳 / 13 位毫秒时间戳 都支持(毫秒会被截断) + +// ===== Redis:app.redis 即 ioredis 实例 ===== +await this.app.redis.set('k', 'v'); +await this.app.redis.setex('k', 60, 'v'); +await this.app.redis.get('k'); + +// 项目封装(见 app/service/cache.js) +await this.ctx.service.cache.set('user:1', { id: 1 }, 60); +await this.ctx.service.cache.remember('user:1', 60, () => loadFromMysql()); +``` + +## 说明 + +- MySQL 通过 `egg-sequelize@6`(Sequelize 6 + mysql2)访问,模型放在 `app/model/`,表结构以 `sql/schema.sql` 为准(未开启 `sequelize.sync`,避免误改表);需要同步表结构时可在启动钩子里显式调用 `app.model.sync()`。 +- **Sequelize 是启动强依赖**:插件在 `beforeStart` 里会 `authenticate()`,连不上数据库时应用启动会失败(重试 3 次后退出);Redis 用 `egg-redis@2`(ioredis),配置了 `client.weakDependent: true`,Redis 不可用不阻塞启动。 +- 时间统一按 `timezone: '+08:00'` 处理;表名/字段名下划线映射、created_at/updated_at 命名在 `config.sequelize.define` 中配置。 +- 用户/微信授权/系统配置的 `deleted_at` 为软删除:普通查询自动过滤,需物理删除时加 `force: true`。 +- `wechat_oauth` 用 `(appid, openid)` 唯一键防重;`sys_config` 的唯一性在 service 层保证(原因见「数据表」一节的说明)。 +- 所有异常经 `app/middleware/error_handler.js` 处理:`/api/*`、`/health`(或声明了 `Accept: application/json` 的请求)统一返回 `{ ok:false, message }`(4xx 原消息、5xx 只回「服务器内部错误」);其它请求返回一行纯文本(正常情况下它们都被 `middleware/frontend.js` 接走了)。 +- **没有模板 / 会话 / CSRF**:`app/view/`、`egg-view-nunjucks`、`egg-session-redis`、`config.view`、`config.session` 全部已删除;接口一律 header 令牌鉴权,`config.security.csrf.enable = false`(没有基于 cookie 的表单了,CSRF 保护已无意义)。 +- **前端的页面与样式在 `../frontend/src/`**:公共样式 `styles/main.css`(卡片 / 表单 / 表格 / 分页 / 徽标),每个页面一个 `views/*.vue`;接口调用统一走 `api/client.ts`(自动带令牌、401 清令牌)+ `api/web.ts`(按接口分组)。 +- 登录密码用 `bcryptjs` 哈希(`app/service/auth.js`,成本因子 10);用户查询默认 `exclude: ['passwordHash']`,任何接口/模板都不会输出哈希。 +- **自助注册**(接口):前端登录页「注册」tab → `POST /api/web/auth/register/code`(发邮箱验证码)→ `POST /api/web/auth/register` → `service.auth.register()`(`user.create` + `setPassword`,用户名/邮箱/手机号重复在 service 层抛 409,接口翻成友好文案)→ 成功直接下发用户 JWT(前端存本地即登录);**邮箱必填**,格式校验后**统一小写入库**; +- **登录账号支持 用户名 / 手机号 / 邮箱**(`service.user.findByAccount()` 的 `Op.or` 同时匹配 `username` / `phone` / `email`);邮箱也能在个人中心修改(同样格式校验 + 小写归一 + 唯一性检查);用户列表的 `keyword` 也搜邮箱; +- 注册开关 `config.register.enable`(环境变量 `REGISTER_ENABLED`,默认开):关掉后发码与注册接口都返回 403「注册已关闭」;这是面向内部管理的服务,**上线建议关闭**并用 `npm run user:pass` 建号; +- **注册必须验证邮箱**(邮箱必填):两步——`POST /api/web/auth/register/code` 发 6 位验证码 → `POST /api/web/auth/register` 带 `code` 校验通过才能建号。 + - 验证码存 Redis(`packs:verify:register:`,TTL `EMAIL_CODE_TTL`,默认 10 分钟);重发节流(`SET NX`,默认 60 秒);错试超过 `EMAIL_CODE_ATTEMPTS`(默认 5 次)作废;**注册成功才消费验证码**(用户名/邮箱冲突时可改完重提,不用重新收码); + - 发信走 `app/service/mail.js`:**未配 `SMTP_HOST` 时是开发模式**(验证码写服务端日志 + 在接口返回里带 `code`,前端直接提示,仅本地/测试);配上 `SMTP_HOST/PORT/USER/PASSWORD/FROM` 后自动改用 nodemailer 真发信(依赖懒加载); + - 验证码逻辑不抛异常,统一返回 `{ ok, message }`,失败都是接口报错(Redis 不可用会提示“验证码服务暂不可用”而不是 500); +- **邮箱找回密码(发重置链接)**:前端「忘记密码?」页 → `POST /api/web/auth/forgot` 生成带令牌的链接并**发到邮箱** → 邮件里的链接打开前端 `/reset?token=...` 设置新密码 → `POST /api/web/auth/reset` 改哈希(**不自动登录**,要求用新密码再登一次)。 + - 令牌存 Redis(`app/service/password_reset.js`):`packs:reset:token:` → 用户 id(TTL `EMAIL_RESET_TTL`,默认 30 分钟)、`packs:reset:user:` → 当前令牌摘要、`packs:reset:sent:` 重发节流(`SET NX`,默认 60 秒);**Redis 里只存摘要,不存令牌原文**(泄库也拿不到可用的链接); + - **一次性**:重置成功后 `consume()` 删掉令牌;**重新申请会让旧链接立刻失效**(同一用户只保留最新一条);校验失败的提交(密码太短/两次不一致/令牌不对)**不会**消费令牌; + - **防账号枚举**:邮箱格式不对才报错;邮箱未注册或账号被禁用时,提示与成功完全一致(“如果该邮箱已注册,链接已经发出”),并且不发信; + - 邮件正文由 `service.mail.sendResetLink()` 生成(与验证码同一套开发模式/SMTP 逻辑:未配 `SMTP_HOST` 时链接写日志 + 接口返回 `url`,前端直接给个可点链接,方便本地点开); + - 链接地址默认取当前请求的 host,正式部署建议配 `SITE_URL`(有反代/多域名时更可靠); + - 待加固(按需):JWT 是无状态的,重置密码后**旧令牌在过期前仍然有效**(要立即失效可给 `users` 加 `password_changed_at`,鉴权中间件里比对); +- **扫码登录**(`app/service/wechat_login.js`):前端登录页在「账号密码 / 注册 / 扫码」三个 tab 之间切(扫码 tab 里就是二维码 + 提示): + - **串码**:服务端生成 **6 位数字 + 字母**随机串码(`WECHAT_CODE_LENGTH`,字符集去掉了 0/O/1/I 等易混字符),写进 Redis `packs:wechat:state:` = `pending`(TTL `WECHAT_STATE_TTL`); + - **二维码内容 = 本站地址**:`http://<域名>/wechat?spm=1.0..1`(spm 格式由 `WECHAT_SPM_PATTERN` 决定);二维码图片本身用零依赖的 `qrcode-generator` 现场画成 **SVG**(`GET /api/wechat/qrcode.svg?code=…`)——**不需要任何外链资源**; + - **完整时序**(都是我们自己的接口,不需要第三方 JS/iframe): + 1. 电脑端调 `GET /api/wechat/login`(不带参数)拿 `code` + `qrUrl`,前端登录页把它画成 `` → 串码登记为 `pending`; + 2. 手机扫码打开前端路由 `/wechat?spm=1.0..1`: + - **配了微信** → 前端页重定向到公众号网页授权(`oauth2/authorize`,`scope=snsapi_base` 静默拿 openid,`state=`)→ 微信回调后端 `GET /api/wechat/callback` → `code` 换 `openid`(`WECHAT_API_BASE`)→ 按 `(appid, openid)` 查 `wechat_oauth` 找账号 → 把 Redis 里串码的值改成**用户 id** → 再 302 回前端 `/wechat?ok=1`; + - **没配微信**(本机默认)→ 前端页给「确认登录」按钮:要求手机端**已登录**(本地有占位令牌),点确认调 `POST /api/wechat/confirm`(带 `Authorization: Bearer `)把串码的值改成用户 id; + 3. 电脑端用 `GET /api/wechat/login?code=…&wait=60` 长轮询取结果 → `{ status:'confirmed', token, user }` 存本地即登录完成(前端登录页会自动跳首页);**取走即删(一次性)**。 + - **JWT 怎么用**:`config.jwt.userExpiresIn`(env `USER_JWT_EXPIRES`,默认 7 天);前端把令牌存 localStorage,调接口时放 `Authorization: Bearer `(`app/middleware/api_auth.js` 只认这个头,不读 cookie/session)。 + - **长轮询(前端接口)**:`GET /api/wechat/login?code=&wait=60` —— 服务端把请求挂起最多 `WECHAT_POLL_WAIT` 秒(默认 60): + - 有人扫码确认 → **立即**返回 `{ status:'confirmed', token, … }`(靠 Redis 发布订阅 `packs:wechat:login:` 唤醒,不是忙轮询;`confirm()` / 微信回调写完状态后 `PUBLISH` 一次); + - 到时间还没动静 / 串码已失效 → 返回 `{ status:'refreshed', code:<新码>, spm, qrUrl, expiresIn, waited }` —— **前端直接换二维码继续轮询**,不用自己判断过期; + - `wait=0` 或不传 → 不挂起,只回 `{ status:'pending' }`(短轮询模式); + - **客户端断开就立即结束挂起**(2026-10-17 修):服务端会监听连接关闭(`res.on('close')`),浏览器导航离开(例如登录页点「返回账号密码登录」)、关页签或前端 `abort()` 时立刻停止等待并释放订阅连接,**不会白等满 `wait` 秒,也不会把串码换掉**(登录页的脚本在 `pagehide` 时会 `abort()` 当前请求);日志里能看到 `[wechat] 客户端已断开,停止等待串码 XXXXXX`; + - ⚠️ **前端要自己设超时**(服务端上限 60s,客户端建议 70s):`AbortController` / `AbortSignal.timeout(70000)`,超时就重发一次请求(或退化成短轮询);重启/热更也会断掉长连接,断了重试即可。**反代/网关要把读超时调到 > 60s**(nginx `proxy_read_timeout 90s`),否则会被代理提前切断; + ```js + let code = null; + async function loop() { + const url = code ? `/api/wechat/login?code=${code}&wait=60` : '/api/wechat/login'; + const ac = new AbortController(); + const timer = setTimeout(() => ac.abort(), 70000); // 前端超时 > 服务端 wait + let r; + try { + r = await (await fetch(url, { signal: ac.signal })).json(); + } catch (err) { // 超时/断网 → 重试 + return setTimeout(loop, 800); + } finally { clearTimeout(timer); } + const d = r.data; + if (d.status === 'confirmed') return localStorage.setItem('token', d.token); + if (d.status === 'refreshed') { code = d.code; img.src = d.qrUrl; } // 换新码 + if (!code) { code = d.code; img.src = d.qrUrl; } // 首次拿码 + loop(); + } + ``` + - **联调/自测(三个终端就能跑通整个扫码登录)**: + ```bash + # ① 电脑端:拿登录码 + curl -s http://127.0.0.1:7001/api/wechat/login + # → {"ok":true,"data":{"code":"XBUBHP","spm":"1.0.XBUBHP.1","qrUrl":"/login/wechat/qrcode.svg?code=XBUBHP",...}} + + # ② 电脑端:挂在长轮询上等(25s 内有人确认就立即返回,没人扫就换新码) + curl -s 'http://127.0.0.1:7001/api/wechat/login?code=XBUBHP&wait=60' + + # ③ 已登录的客户端(或用手机打开 /wechat?spm=1.0.XBUBHP.1):用登录码触发登录 + curl -s -X POST http://127.0.0.1:7001/api/wechat/confirm \ + -H 'Authorization: Bearer <用户JWT>' -H 'Content-Type: application/json' \ + -d '{"code":"XBUBHP"}' + # → ② 的请求会立即返回 {"data":{"status":"confirmed","token":"",...}} + ``` + `POST /api/wechat/confirm` 的 **鉴权完全走 header**(`app/middleware/api_auth.js`:`Authorization: Bearer <用户JWT>`,也认 `X-Access-Token`)——**不读 session/cookie**,所以小程序 / App / SPA 直接帯令牌就行,也不写 session;它返回 401(缺令牌)/ 403(账号被禁用)/ 422(码格式不对)/ 410(码失效、已过期或已用过);`/api/*` 不过 CSRF,所以 curl 不用带 token。 + - **不自动建号**:扫码只对已绑定微信的账号生效(绑定关系在 `wechat_oauth`,可用 `POST /api/wechat/bind` 写入),未绑定会提示先用账号密码登录;账号被禁用(`status != 1`)拒绝登录; + - **小程序接入**(小程序里「扫码 → 直接登录电脑端」):接口都是 JSON,**鉴权只看 header 里的 `Authorization: Bearer <用户 JWT>`,不认 cookie/session**(`app/middleware/api_auth.js`);用户 JWT 用 `USER_JWT_EXPIRES`(默认 7d)控制有效期,由登录接口/扫码登录接口下发。 + ```js + // 小程序侧:扫登录页上的二维码(内容 http://<域名>/wechat?spm=1.0.<码>.1) + wx.scanCode({ + success (scan) { + // ① 先问一下这个码还在不在(可选,但能给出更好的提示) + wx.request({ + url: `https://<域名>/api/wechat/status?spm=${encodeURIComponent(scan.result)}`, + success (r) { + // r.data.data.status: pending(待扫)/ confirmed(已被确认)/ expired(没这个码) + } + }); + + // ② 确认登录:把扫到的整条地址丢进来就行(接口自己抽 6 位码) + wx.request({ + url: 'https://<域名>/api/wechat/confirm', + method: 'POST', + header: { 'Content-Type': 'application/json', Authorization: 'Bearer ' + userJwt }, + data: { spm: scan.result }, // 也可以传 { code: 'AB12CD' } + success (r) { + if (r.statusCode === 200 && r.data.data.status === 'confirmed') { + wx.showToast({ title: '登录成功' }); // 电脑端那台浏览器已经进系统了 + } else { + wx.showToast({ title: r.data.message, icon: 'none' }); // 401/422/410 的错误原因 + } + } + }); + } + }); + ``` + 返回:成功 `HTTP 200 { ok:true, data:{ status:'confirmed', code, spm, user:{ id, username, nickname } } }`; + 失败 `HTTP 401 status=unauthorized`(没带/过期令牌)、`422 bad_format`(码格式不对)、`410 expired`(没这个码/已过期)、`410 used`(已被用过); + - **设备专用:扫码登录 + 注册(`GET /api/device/login`,`app/controller/device.js`)**:给「设备上不好敲账号密码、甚至**出厂什么都不用配**」的场景用—— + **登录即注册**:设备插上电直接要一个登录码显示在**设备屏幕上**,用已经登录的手机(小程序/网页)扫一下确认, + 服务端**这才**把设备注册到那个账号名下(归属 = 确认登录的人),并把**长期 JWT** 发给设备 + (默认 365 天,见 `config.jwt.deviceExpiresIn` / env `DEVICE_JWT_EXPIRES`; + 设备可用 `?expiresIn=30d`(或秒数)申请**更短**的,超上限 422): + - **不需要凭据、也不需要预先注册**(与 `GET /api/wechat/login` 一样是公开接口); + - **不带 `code`**:发一张新登录码(此时**库里还没有任何记录**),返回 + `{ status:'pending', expiresIn, code, spm, origin, qrContent, qrImageUrl, qrUrl, device:{ sn, name } }` + —— **域名不用设备自己拼**:`qrContent` 就是二维码里该编的**完整**网址(`http://<域名>/wechat?spm=…`), + `qrImageUrl` 是完整地址的现成 SVG(设备不会画二维码就直接拉这张图),`qrUrl` 是它的相对路径,`origin` 是本次用的域名; + 域名取 `SITE_URL`(`config.email.siteUrl`)——有反代/多域名、或**设备走内网而扫码的手机要走公网**时建议配上;没配就用设备请求时的 origin(设备访问服务用的那个地址); + - **设备信息(可选)**:`?sn=`(设备序列号)、`name` / `vendor` / `model` / `firmware`;**发码时带上最省事** + (服务端暂存 `packs:device:info:`,确认/换码时沿用),轮询时再带(补齐/覆盖)也行;不带 SN 时服务端注册那一步生成一个 `DEV-…` 并返回给设备保存; + - **带 `?code=&wait=N`**:**长轮询**(与 `/api/wechat/login` 完全同一套实现与上限 `WECHAT_POLL_WAIT`,默认 60s): + - 手机确认 → **立即**返回 `{ status:'confirmed', firstTime, sn, token, tokenType, expiresIn, expiresAt, scanner, user }`; + - 到时间没人扫 / 码已失效 → `{ status:'refreshed', code:<新码>, spm, qrContent, qrImageUrl, … }`(设备换二维码后继续轮询); + - 设备断开(重启/换页)→ 服务端**立刻**停止等待(`aborted`,不写响应、也不换码); + - 不带 `wait` 就是短轮询,只查一次(`pending` 时还带 `expiresIn` 剩余秒数); + - **确认仍走现有接口** `POST /api/wechat/confirm`(**不为设备新增确认接口**);用的也是同一套 6 位串码, + 所以设备码同样能被 `GET /api/wechat/status` 查、也能被手机上的 `/wechat?spm=…` 页面消费; + - **确认成功(就是「注册」发生的时刻,`service/scanner.js` 的 `loginByScan()`)**: + - 该 SN 没有记录 → **新建**:绑到确认的用户,`firstTime: true`(记录是在确认那一刻才建的); + - 该 SN 已有记录且**无主**(历史数据里的 `user_id = NULL`)或**曾被软删** → 由确认者**认领**(软删的 `restore()` 复活),`firstTime: false`; + - 该 SN **已绑定到别的账号** → **403**,拒绝(避免扫一下就把别人的设备换绑走);设备被禁用(`status=0`)→ 403; + - 无论哪条路径都会换发长期 JWT(`jti` 轮换 → 设备上一次的令牌立即失效); + - 登录码**一次性**:被设备取走即删除(同一张码不能给第二台设备用,浏览器页面长轮询与设备长轮询谁先取走算谁的); + - 联调(**新设备不需要先注册**;第三终端是已登录的手机/小程序): + ```bash + # ① 设备发码(拿 code / qrContent / qrImageUrl 显示二维码;带上自己的 SN 与名称) + curl -s 'http://127.0.0.1:7001/api/device/login?sn=SN-NEW-01&name=门口扫码枪' + + # ② 设备挂长轮询(有人确认就立即返回;参数带上也行) + curl -s 'http://127.0.0.1:7001/api/device/login?sn=SN-NEW-01&code=<登录码>&wait=60' + + # ③ 手机确认(现有接口,鉴权走 header,不认 cookie) + curl -s -X POST http://127.0.0.1:7001/api/wechat/confirm \ + -H 'Authorization: Bearer <用户JWT>' -H 'Content-Type: application/json' \ + -d '{"code":"<登录码>"}' + # → ② 立即返回 {"data":{"status":"confirmed","firstTime":true,"sn":"SN-NEW-01", + # "token":"<长期JWT>","expiresIn":"365d","expiresAt":"...","scanner":{...},"user":{...}}} + ``` + - 设备端逻辑(伪代码,轮询到 `refreshed` 就换二维码继续): + ```js + const sn = localStorage.getItem('sn') || 'SN-NEW-01'; // 设备自己的序列号(可固定) + let code = null; + for (;;) { + const url = code + ? `/api/device/login?code=${code}&wait=60&sn=${sn}` + : `/api/device/login?sn=${sn}&name=门口扫码枪`; + const r = await (await fetch(url)).json(); + const d = r.data; + if (d.status === 'confirmed') { + saveToken(d.token); // 长期 JWT(365d),后续请求带 Authorization: Bearer + saveSn(d.sn); // 服务端确认的 SN(没自带 SN 时以这个为准) + break; + } + code = d.code; // pending / refreshed 都带回可用的码 + showQrcode(d.qrContent); // 直接编 qrContent(已是完整网址,设备无需知道域名) + } + ``` + - 未配 `WECHAT_APPID`/`WECHAT_SECRET`(本机默认):二维码照旧本地生成(内容是本站 `/wechat?spm=…`),扫码面板**不显示任何说明文字**(只留二维码 + 「返回账号密码登录」),扫码后走「手机确认登录」降级路径; +- 新增/重置登录账号:`npm run user:pass -- <账号> <密码> [昵称]`。 +- 设备身份**只有长期 JWT 一种**:列表/详情/`me` 接口**不会**返回 `token_jti`(`sanitize()` 兜底);`secret_hash` 是历史字段(已不再写入)。 +- **软删除的行仍占着唯一键**:`scanners.sn` 是唯一键而 `deleted_at` 的软删行还在库里,所以扫码登录(`loginByScan()`)**带上已删除的一起查**,命中就把那条记录**复活**(`restore()`,与 `scan.js` 里通道的处理一致),否则 `create` 会撞唯一键; +- 前端「设备管理」页的解绑/删除按钮调 `POST /api/web/devices/:id/unbind` 与 `DELETE /api/web/devices/:id`;前端「测试页」提交后直接展示结果(含长期 JWT),刷新页签不会重复建设备(同 SN = 同一台,只换发令牌); +- 扫描器接口 `/api/scanner/{me,heartbeat}` 走 `app/middleware/scanner_auth.js` 的 JWT 鉴权;接口里的“缺令牌→401 / 被禁用→403 / jti 被轮换→401”语义见上文「扫描器通讯用的长期 JWT」; +- 设备扫码登录 `GET /api/device/login` **不需要任何凭据、也不需要设备预先注册**:发码只写 Redis(库里不建任何东西), + 确认成功那一刻(就是「注册」时刻)才按 SN 建/取记录、绑定到确认登录的用户、发长期 JWT;确认环节复用 + `POST /api/wechat/confirm` 与同一套 6 位串码(`service/wechatLogin`),**不新增确认接口、不新增 Redis key 空间**; + `SN 已属于其他账号 → 403`(不会把别人的设备扫走),无主记录(老接口注册出来的)由本次确认者认领; +- **没有 CSRF**:后端已关掉 CSRF(`config.security.csrf.enable = false`),页面表单/会话都没了;扫描器用 JWT 调 JSON 接口不会遇到 403; +- 扫码去重放在**数据库唯一键 + 服务层预过滤**两层:唯一键 `(scanner_id, channel_id, barcode, scan_time)` 是最终保证,服务层先查一次再做批量插入(并发撞键时退化为逐条插入并计数),所以重复上报既不报错也不产生脏数据; +- 扫码记录是**流水表、不用软删除**(`paranoid: false`):软删除会让记录占用唯一键,导致同一条数据无法再入库;清理请按时间物理删除; +- 中控上报遇到未登记的通道会自动补建一行(`channel_name` 留空 + WARN 日志),避免丢数据;若希望严格模式,可在 `app/service/scan.js` 的 `touchChannels()` 里改成抛错; +- 前端「测试页」的「模拟中控上报」卡片用**设备 SN + 长期 JWT** 校验身份(验签 + 回查 + 比对 `jti`,与 `middleware/scannerAuth()` 同一条 `service.scanner.resolveByToken()`),再走 `service.scan.*`,等价于设备的 `POST /api/scan/channels` + `POST /api/scan/records`(提交两次即可看到 `duplicated=1`);令牌就是上一张卡片发下来的那枚,重新扫码登录会换新令牌(旧令牌立即失效); +- 前端「测试页」的「模拟扫码授权(AJAX)」卡片:一个输入框(填登录码,或直接贴 `/wechat?spm=…` 整条地址)+「查状态」「请求登录」两个按钮,**AJAX 调接口并把返回的 JSON 原样显示,不跳转**: + - 「查状态」→ `GET /api/wechat/status?code=…`(无需登录):`pending`(待扫码)/ `confirmed`(已被确认)/ `expired`(没这个码); + - 「请求登录」→ `POST /api/wechat/confirm`(`{ code }`):`data.status='confirmed'` 即授权成功,电脑端正在长轮询的请求会**立即**完成登录;已用过/不存在/格式错分别返回 `used` / `expired` / `bad_format`; + - **鉴权完全模仿小程序**:AJAX 把用户 JWT 放在 `Authorization: Bearer` 头里(`fetch` 不带 `credentials`),页面上也把这枚令牌显示出来方便贴到小程序里调试; +- **鉴权总览**:`/api/web/*`、`/api/wechat/confirm` 走 `app/middleware/api_auth.js`(**只认 header 里的用户令牌**);`/api/users*`、`/api/configs*`、`/api/scanners*` 走 `app/middleware/internal_auth.js`(`X-Internal-Token` 或白名单账号的 user JWT);`/api/scanner/*`、`/api/scan/*` 走 `app/middleware/scanner_auth.js`(设备长期 JWT);公开接口只有 `/api/info`、`/health`、`/api/wechat/{login,status,qrcode.svg,callback}`、`/api/device/login` 与 `/api/web/auth/*`; +- 密码等敏感信息放 `config/config.local.js`(已 gitignore)或环境变量,不要写进 `config.default.js`。 +- 生产环境请修改 `config/config.default.js` 中的 `config.keys`。 diff --git a/backend/app/controller/auth/wechat.js b/backend/app/controller/auth/wechat.js new file mode 100644 index 0000000..1bce9c0 --- /dev/null +++ b/backend/app/controller/auth/wechat.js @@ -0,0 +1,169 @@ +'use strict'; + +const { Controller } = require('egg'); + +/** + * 扫码登录的**公开**接口(发码 / 查码)—— 谁来调都行,不需要令牌 + * + * 面向:登录页(浏览器内联脚本)、Win 客户端、任何想自己画二维码显示的前端。 + * 确认环节在 `app/controller/client/wechat.js`(需要 user JWT);设备端扫码登录在 `app/controller/device/auth.js`。 + */ +class WechatAuthController extends Controller { + /** + * GET /api/wechat/qrcode.svg?code=xxxxxx —— 登录码的二维码(SVG,**本地生成**,零外链) + * 内容就是本站地址 `/wechat?spm=1.0.<码>.1`(手机扫到后打开前端路由) + */ + async qrcode() { + const { ctx } = this; + const code = String(ctx.query.code || ''); + const content = ctx.service.wechatLogin.qrContent({ code, origin: ctx.app.config.email.siteUrl || ctx.origin }); + + ctx.set('Cache-Control', 'no-store'); + ctx.type = 'image/svg+xml; charset=utf-8'; + ctx.body = ctx.service.wechatLogin.qrSvg(content); + } + + /** + * GET /api/wechat/login —— 扫码登录接口(前端 JS/SPA 用,不依赖页面渲染) + * - **不带参数**:生成一个 6 位串码(数字+字母,存 Redis)并返回二维码地址,前端拿去画二维码; + * - **带 `?code=`**:轮询状态;手机确认后:**写入登录会话 + 返回用户 JWT**,前端存下 JWT 即完成登录。 + */ + async login() { + const { ctx } = this; + const svc = ctx.service.wechatLogin; + const raw = String(ctx.query.code || '').trim(); + + if (!raw) { + const code = await svc.newCode(); + ctx.body = { + ok: true, + data: { + code, + spm: svc.spm(code), + qrUrl: `/api/wechat/qrcode.svg?code=${encodeURIComponent(code)}`, + expiresIn: svc.stateTtl, + }, + }; + return; + } + + const code = raw.toUpperCase(); + const expect = Number(ctx.app.config.wechat.codeLength || 6); + if (!new RegExp(`^[0-9A-Z]{${expect}}$`).test(code)) { + ctx.status = 422; + ctx.body = { ok: false, message: `code 格式不对(${expect} 位数字 + 字母)` }; + return; + } + + // ?wait=25 走长轮询(最多挂起到 config.wechat.pollWait):有人登录立即返回, + // 到时间还没动静就直接给一张新码(status=refreshed),前端换二维码后继续请求 + const result = await svc.awaitLogin(code, { wait: ctx.query.wait }); + + if (result.status === 'aborted') { + // 客户端已经断开(切回账号密码登录 / 关页签 / 前端 abort):没什么可回的,也不用写响应 + ctx.respond = false; + return; + } + + if (result.status === 'refreshed') { + ctx.body = { + ok: true, + data: { + status: 'refreshed', + code: result.code, + spm: svc.spm(result.code), + qrUrl: `/api/wechat/qrcode.svg?code=${encodeURIComponent(result.code)}`, + expiresIn: svc.stateTtl, + waited: result.waited || 0, + }, + }; + return; + } + if (result.status !== 'confirmed') { + ctx.body = { ok: true, data: { status: result.status } }; + return; + } + + // 手机已确认:后端只下发 JWT(前端存本地),**不写 cookie/session** + const user = result.user; + ctx.logger.info('[wechat] %s 扫码登录成功(API)', user.username); + + ctx.body = { + ok: true, + data: { + status: 'confirmed', + token: result.token, + tokenType: result.tokenType, + expiresIn: result.expiresIn, + user: { + id: user.id, + username: user.username, + nickname: user.nickname || null, + email: user.email || null, + phone: user.phone || null, + avatar: user.avatar || null, + }, + }, + }; + } + + /** + * GET /api/wechat/callback?code=&state= —— 微信公众号网页授权回调 + * + * 微信把**手机浏览器**重定向到这里(回调地址可在微信平台配 `WECHAT_REDIRECT_URI`, + * 不配就用 `/api/wechat/callback`)。这里不登录扫码设备,只把「已确认的用户 id」 + * 写进 Redis,等电脑上的登录页长轮询取走;处理完把浏览器转回**前端**的 `/wechat` 路由, + * 由前端给出“已确认/失败”的文案。 + */ + async callback() { + const { ctx } = this; + const state = String(ctx.query.state || ''); + const result = await ctx.service.wechatLogin.login(String(ctx.query.code || ''), state); + + if (!result.ok) ctx.logger.warn('[wechat] 扫码失败: %s', result.message); + + const spm = ctx.service.wechatLogin.parseSpm(state) ? ctx.service.wechatLogin.spm(state) : ''; + const base = String(ctx.app.config.email.siteUrl || ctx.origin || '').replace(/\/+$/, ''); + const query = new URLSearchParams({ ok: result.ok ? '1' : '0' }); + if (spm) query.set('spm', spm); + if (!result.ok) query.set('message', result.message || '扫码失败,请重新扫码'); + + ctx.redirect(`${base}/wechat?${query.toString()}`); + } + + /** + * GET /api/wechat/status —— 查串码状态(**无需登录**,小程序/网页先问一下再决定怎么提示) + * + * query: `?code=` 或 `?spm=`(也可以直接把二维码里扫到的整条地址丢进来) + * 返回 `data.status`:pending(待扫码)/ confirmed(已被确认)/ expired(不存在或已过期,即“没这个码”) + */ + async status() { + const { ctx } = this; + const svc = ctx.service.wechatLogin; + const code = svc.parseSpm(ctx.query.code || ctx.query.spm); + + if (!code) { + ctx.status = 422; + ctx.body = { + ok: false, + status: 'bad_format', + message: `登录码格式不对(${Number(ctx.app.config.wechat.codeLength || 6)} 位数字 + 字母)`, + }; + return; + } + + const state = await svc.statusOf(code); + ctx.body = { + ok: true, + data: { + status: state.status, + code, + spm: svc.spm(code), + qrUrl: `/api/wechat/qrcode.svg?code=${encodeURIComponent(code)}`, + expiresIn: state.expiresIn, + }, + }; + } +} + +module.exports = WechatAuthController; diff --git a/backend/app/controller/client/wechat.js b/backend/app/controller/client/wechat.js new file mode 100644 index 0000000..58eb308 --- /dev/null +++ b/backend/app/controller/client/wechat.js @@ -0,0 +1,72 @@ +'use strict'; + +const { Controller } = require('egg'); + +/** + * 用户态接口(小程序 / Win 客户端 / SPA 共用) + * + * 鉴权:`middleware.apiAuth()` —— **只认 header 里的 user JWT**(`Authorization: Bearer `, + * 也认 `X-Access-Token`),不看 cookie / session;用户令牌自带 `typ: 'user'`, + * 与设备令牌(`typ: 'scanner'`)互不通用。 + * + * 小程序和 Win 客户端之所以共用一套路径:它们身份相同(都是「某个登录用户」), + * 区别只在登录入口;要区分用途请用 header(如 `X-Client: miniapp|win`),不要复制一套路径。 + */ +class ClientWechatController extends Controller { + /** + * POST /api/wechat/confirm —— 把登录码断权给当前登录用户(触发电脑端/客户端登录) + * + * 典型用法(小程序):扫码拿到 `http://<域名>/wechat?spm=1.0.<码>.1`,把扫到的整串、 + * `spm` 或 6 位 `code` 丢过来即可(接口自己抽码);后端把码断权给当前登录用户, + * 电脑端正在长轮询的请求会**立即**拿到 JWT 完成登录。 + * + * 需要登录:**只看 header**(`Authorization: Bearer ` 或 `X-Access-Token`),不认 cookie + * body: `{ code | spm }`,也支持 `?code=` / `?spm=`(JSON / 表单 / query 都行) + * + * 返回:成功 `data.status=confirmed`;失败时 body.status = bad_format(422) / expired(410) / + * used(410) / unauthorized(401) / forbidden(403) + */ + async confirm() { + const { ctx } = this; + const body = ctx.request.body || {}; + const raw = body.code || body.spm || ctx.query.code || ctx.query.spm; + // 用户只从 header 令牌解析(middleware/api_auth.js 挂的),不从 session 取 + const user = (ctx.locals && ctx.locals.user) || (ctx.state && ctx.state.user) || null; + const userId = user && user.id; + + const code = ctx.service.wechatLogin.parseSpm(raw); + if (!code) { + ctx.status = 422; + ctx.body = { + ok: false, + status: 'bad_format', + message: `登录码格式不对(${Number(ctx.app.config.wechat.codeLength || 6)} 位数字 + 字母)`, + }; + return; + } + + const result = await ctx.service.wechatLogin.confirm(code, userId); + if (!result.ok) { + // 码不存在/已过期/已被用过 → 410;参数不全 → 422 + ctx.status = result.reason === 'bad_param' ? 422 : 410; + ctx.body = { ok: false, status: result.reason, message: result.message }; + return; + } + + ctx.body = { + ok: true, + data: { + status: 'confirmed', + code, + spm: ctx.service.wechatLogin.spm(code), + user: { + id: userId, + username: (user && user.username) || null, + nickname: (user && user.nickname) || null, + }, + }, + }; + } +} + +module.exports = ClientWechatController; diff --git a/backend/app/controller/device/auth.js b/backend/app/controller/device/auth.js new file mode 100644 index 0000000..9a76c27 --- /dev/null +++ b/backend/app/controller/device/auth.js @@ -0,0 +1,237 @@ +'use strict'; + +const { Controller } = require('egg'); + +/** + * 取设备自报信息(**全部可选**,不带也能用) + * 设备上**不需要预先注册/预先配密钥**:发码与轮询时把自己的序列号等信息带上, + * 服务端在「确认登录成功」那一步才用它建记录。 + */ +function deviceInfo(ctx) { + const q = ctx.query; + return { + sn: String(q.sn || '').trim() || null, + name: q.name || '', + vendor: q.vendor || null, + model: q.model || null, + firmware: q.firmware || null, + }; +} + +/** + * 合并设备信息:本次请求里带了就用请求的(空值不算),没带就用发码时暂存的那份 + * (建记录发生在确认/换码那一刻,设备只在发码时带过 sn/名称也能生效) + */ +function mergeInfo(fromQuery, stashed) { + const info = Object.assign({}, stashed || {}); + for (const [ key, value ] of Object.entries(fromQuery)) { + if (value !== null && value !== '' && value !== undefined) info[key] = value; + } + return info; +} + +/** + * 令牌时长:默认 `config.jwt.deviceExpiresIn`(env `DEVICE_JWT_EXPIRES`,默认 365d), + * 设备可以用 `?expiresIn=30d`(或 `3600` 秒)申请**更短**的;超过上限直接 422 + * (要整体放宽就改配置,不让单个设备自己把令牌拉长) + * @return {{spec:string|number, seconds:number}} spec 用于回显,seconds 用于签发 + */ +function resolveTokenDuration(ctx) { + const { jwt } = ctx.app.config; + const current = String(jwt.deviceExpiresIn || jwt.scannerExpiresIn || '365d'); + const max = ctx.service.jwt.parseDuration(current); + const raw = String(ctx.query.expiresIn || '').trim(); + + if (!raw) return { spec: current, seconds: max }; + + const seconds = ctx.service.jwt.parseDuration(raw); + if (!seconds) { + ctx.throw(422, 'expiresIn 格式不对(支持 30d / 12h / 90m / 3600 这类写法)'); + } + if (max && seconds > max) { + ctx.throw(422, `expiresIn 不能超过服务端上限 ${current}(要放宽请改 DEVICE_JWT_EXPIRES)`); + } + return { spec: /^\d+$/.test(raw) ? Number(raw) : raw, seconds }; +} + +/** + * 设备(扫描器)专用接口 + * + * **登录即注册**:设备出厂后什么都不用配,插上电调本接口拿到一个登录码显示出来, + * 用已经登录的手机(小程序/网页)扫一下确认,服务端这才把设备**注册**到那个账号名下, + * 并把**长期 JWT**(默认 365 天,见 `config.jwt.scannerExpiresIn`)发给设备。 + * 不会再出现「先注册出一条无主记录、回头再绑定」的顺序问题。 + */ +class DeviceController extends Controller { + /** + * 登录码相关的响应字段(**带完整域名**) + * + * 设备常常**不知道本站域名**(或只知道内网 IP),所以这里直接把「二维码里该编什么」算好给它: + * - `qrContent`:二维码要编码的**完整**网址 `http://<域名>/wechat?spm=…`,直接拿去生成二维码; + * - `qrImageUrl`:本站现成 SVG 二维码的**完整**地址(设备不会画二维码时可直接拉这张图;内容与本接口一致); + * - `qrUrl`:同上的相对路径(老字段,给只需要相对路径的客户端用); + * - `origin`:本次用的域名(调试/纯文本展示用)。 + * + * 域名优先取 `SITE_URL`(`config.email.siteUrl`,有反代/多域名/内网设备而对端要走公网时建议配上), + * 没配就用设备请求时的 origin(也就是设备访问服务用的那个地址)。 + * @param {string} code 登录码 + */ + qrFields(code) { + const { ctx } = this; + const base = String(ctx.app.config.email.siteUrl || ctx.origin || '').replace(/\/+$/, ''); + const path = `/api/wechat/qrcode.svg?code=${encodeURIComponent(code)}`; + + return { + code, + spm: ctx.service.wechatLogin.spm(code), + origin: base, + qrContent: ctx.service.wechatLogin.qrContent({ code, origin: base }), + qrImageUrl: `${base}${path}`, + qrUrl: path, + }; + } + + /** + * GET /api/device/login —— 设备专用「扫码登录 + 注册/绑定」(参考 `GET /api/wechat/login`,区别是下发**长期** JWT) + * + * 设备信息(`?sn=` 设备序列号、`name` / `vendor` / `model` / `firmware`)**都是可选的**: + * **发码时带上最省事**(服务端会暂存,确认/换码时沿用),轮询时再带上(补齐/覆盖)也行; + * 不带 SN 时服务端在注册那一步生成一个(`DEV-…`)并返回给设备保存。 + * + * 三种用法(**不需要任何凭据**,与 `GET /api/wechat/login` 一样是公开接口): + * 1. **不带 `code`**:发一张新登录码(登记为 pending)→ `{ status:'pending', expiresIn, code, spm, + * origin, qrContent, qrImageUrl, qrUrl, device:{ sn, name } }`;**此时还没有注册任何东西**; + * 2. **带 `code=&wait=N`**:**长轮询**(挂起最多 `WECHAT_POLL_WAIT` 秒,默认 60)—— + * 手机用 `POST /api/wechat/confirm` 确认后**立即**返回; + * 到时间没人扫 / 码失效 → `refreshed` + 一张新码(设备换二维码后继续轮询,参数照旧带上); + * 设备断开 → 服务端立刻停止等待(`aborted`,不写响应、也不换码); + * 3. **带 `code` 不带 `wait`**:短轮询,只查一次。 + * + * **确认成功后**(就是「注册」发生的时刻,归属 = 扫码确认的那个用户): + * - 该 SN 没有记录 → **新建**:绑到该用户,`firstTime: true`; + * - 该 SN 已有记录且**无主**(或曾被软删)→ 由确认者**认领**(复活),`firstTime: false`; + * - 该 SN **已绑定到别的账号** → 403,拒绝(避免把别人的设备扫走);设备被禁用 → 403; + * - 换发长期 JWT(`jti` 轮换 → 设备上一次的令牌立即失效),返回 `token` / `expiresIn` / `expiresAt`。 + * + * **令牌时长**:默认 `config.jwt.deviceExpiresIn`(env `DEVICE_JWT_EXPIRES`,默认 365d); + * 设备可用 `?expiresIn=30d`(或秒数,如 `3600`)申请**更短**的,超过上限返回 422 + * (要整体放宽改 `DEVICE_JWT_EXPIRES`,不允许单个设备把令牌拉长)。 + * + * 返回 `data.status`: + * - `pending`(已发码,等扫码)/ `confirmed`(成功:`token` + `sn` + `firstTime` + `expiresAt` + `scanner` + `user`) + * - `refreshed`(码没了/等超时:`code`/`spm`/`qrContent`… 是新的一张,直接换二维码) + * - 失败:403(SN 已被别人绑定 / 设备被禁用)、422(`expiresIn` 格式不对或超上限、`code` 格式不对) + */ + async login() { + const { ctx } = this; + const svc = ctx.service.wechatLogin; + const info = deviceInfo(ctx); + const tokenDuration = resolveTokenDuration(ctx); + const raw = String(ctx.query.code || '').trim(); + + // ① 没带 code:发一张新码给设备显示(**公开接口,不需要先注册**) + if (!raw) { + const code = await svc.newCode(); + // 设备自报信息暂存一份(可选):确认成功那一刻才是建记录的时机,这样漏传也能沿用 + await svc.saveDeviceInfo(code, info); + ctx.body = { + ok: true, + data: Object.assign( + { status: 'pending', expiresIn: svc.stateTtl }, + this.qrFields(code), + { device: { sn: info.sn, name: info.name || null } }, + ), + }; + return; + } + + // ② 带 code:校验格式后长轮询(长度/字符集与登录页的码一致) + const code = raw.toUpperCase(); + const expect = Number(ctx.app.config.wechat.codeLength || 6); + if (!new RegExp(`^[0-9A-Z]{${expect}}$`).test(code)) { + ctx.status = 422; + ctx.body = { ok: false, message: `code 格式不对(${expect} 位数字 + 字母)` }; + return; + } + + // 设备端不需要用户 JWT,所以只取「谁确认了」,长期令牌由这里自己签发 + const result = await svc.awaitLogin(code, { wait: ctx.query.wait, withToken: false }); + + if (result.status === 'aborted') { + // 设备断开了(重启/换页):没什么可回的,也不用写响应 + ctx.respond = false; + return; + } + + if (result.status === 'refreshed') { + // 换码:把设备信息接着存在新码上(否则下一轮拿到新码时 sn/名称就丢了) + const kept = mergeInfo(info, await svc.takeDeviceInfo(code)); + await svc.saveDeviceInfo(result.code, kept); + ctx.body = { + ok: true, + data: Object.assign( + { status: 'refreshed', expiresIn: svc.stateTtl, waited: result.waited || 0 }, + this.qrFields(result.code), + { device: { sn: kept.sn || null, name: kept.name || null } }, + ), + }; + return; + } + + if (result.status !== 'confirmed') { + // pending:码还在,继续等就行(顺带把完整二维码地址再给一次,设备可随时重画) + ctx.body = { + ok: true, + data: Object.assign( + { status: result.status, expiresIn: await svc.ttlOf(code) }, + this.qrFields(code), + { device: { sn: info.sn, name: info.name || null } }, + ), + }; + return; + } + + // ③ 有人确认了 —— **这一步才注册/绑定**(归属就是确认登录的人),并换发长期 JWT + const user = result.user; + const merged = mergeInfo(info, await svc.takeDeviceInfo(code)); + const data = await ctx.service.scanner.loginByScan(Object.assign({}, merged, { + userId: user.id, + ip: ctx.ip, + expiresIn: tokenDuration.seconds, + })); + + ctx.logger.info('[device] %s 扫码登录成功(%s),归属账号 %s', + data.sn, data.firstTime ? '首次注册' : '已注册/认领', user.username || user.id); + + ctx.body = { + ok: true, + data: { + status: 'confirmed', + firstTime: data.firstTime, // true = 本次扫码才注册出这条记录 + sn: data.sn, + token: data.token, + tokenType: data.tokenType, + expiresIn: tokenDuration.spec, // 实际生效的时长(数字=秒;字符串=与配置同款写法) + expiresAt: data.tokenExpiresAt || null, // 令牌到期时间(绝对时间,方便设备直接排期重扫) + scanner: { + id: data.id, + sn: data.sn, + name: data.name || null, + userId: data.userId || null, + status: data.status, + lastSeenAt: data.lastSeenAt || null, + }, + user: { + id: user.id, + username: user.username || null, + nickname: user.nickname || null, + email: user.email || null, + phone: user.phone || null, + avatar: user.avatar || null, + }, + }, + }; + } +} + +module.exports = DeviceController; diff --git a/backend/app/controller/device/scan.js b/backend/app/controller/device/scan.js new file mode 100644 index 0000000..1d02924 --- /dev/null +++ b/backend/app/controller/device/scan.js @@ -0,0 +1,93 @@ +'use strict'; + +const { Controller } = require('egg'); + +/** + * 把上报体里的数组字段取出来,兼容几种写法: + * - { channels: [...] } / { records: [...] } + * - { channelId, channelName } / { barcode, scanTime, channelId }(单条) + * - { channels: '[{...}]' }(JSON 字符串,有些设备端会这么塞) + */ +function pickList(body, key, single) { + const raw = body[key]; + if (Array.isArray(raw)) return raw; + if (typeof raw === 'string' && raw.trim()) { + try { + const parsed = JSON.parse(raw); + if (Array.isArray(parsed)) return parsed; + if (parsed && typeof parsed === 'object') return [ parsed ]; + } catch (_) { + return []; + } + } + if (raw && typeof raw === 'object') return [ raw ]; + if (body[single]) return [ body ]; + return []; +} + +class ScanController extends Controller { + /** + * POST /api/scan/channels —— 中控上报通道(需长期 JWT) + * body: { channels: [{ channelId, channelName }] } + * 同一中控 + 同一 channelId 为同一个通道,重复上报即更新通道名 + */ + async reportChannels() { + const { ctx } = this; + const body = ctx.request.body || {}; + const channels = pickList(body, 'channels', 'channelId'); + if (!channels.length) ctx.throw(422, 'channels 不能为空,body 形如 { channels: [{ channelId, channelName }] }'); + + const data = await ctx.service.scan.reportChannels(ctx.state.scanner, channels); + ctx.body = { ok: true, data }; + } + + /** GET /api/scan/channels —— 当前中控已登记的通道(需长期 JWT) */ + async channels() { + const { ctx } = this; + const { page, pageSize, keyword, status } = ctx.query; + const data = await ctx.service.scan.listChannels({ + page, + pageSize, + keyword, + status, + scannerId: ctx.state.scanner.id, + }); + ctx.body = { ok: true, data }; + } + + /** + * POST /api/scan/records —— 中控上报扫码结果(需长期 JWT) + * body: { records: [{ barcode, scanTime, channelId }] } + * 同一中控 + 通道 + 条码 + 扫描时间(秒) 重复上报只入库一次,不报错 + */ + async reportRecords() { + const { ctx } = this; + const body = ctx.request.body || {}; + const records = pickList(body, 'records', 'barcode'); + if (!records.length) ctx.throw(422, 'records 不能为空,body 形如 { records: [{ barcode, scanTime, channelId }] }'); + + const data = await ctx.service.scan.ingest(ctx.state.scanner, records); + ctx.body = { ok: true, data }; + } + + /** + * GET /api/scan/records —— 查当前中控上报的扫码记录(需长期 JWT) + * query: page / pageSize / channelId / barcode / startTime / endTime + */ + async records() { + const { ctx } = this; + const { page, pageSize, channelId, barcode, startTime, endTime } = ctx.query; + const data = await ctx.service.scan.listRecords({ + page, + pageSize, + channelId, + barcode, + startTime, + endTime, + scannerId: ctx.state.scanner.id, + }); + ctx.body = { ok: true, data }; + } +} + +module.exports = ScanController; diff --git a/backend/app/controller/device/self.js b/backend/app/controller/device/self.js new file mode 100644 index 0000000..6ab4bdf --- /dev/null +++ b/backend/app/controller/device/self.js @@ -0,0 +1,41 @@ +'use strict'; + +const { Controller } = require('egg'); + +/** + * 设备自检 / 保活(**需设备长期 JWT**) + * + * 鉴权:`middleware.scannerAuth()` —— `Authorization: Bearer `(也认 `X-Scanner-Token` / + * `?access_token=`);令牌自带 `typ: 'scanner'`,用户令牌(`typ: 'user'`)用不了。 + * 令牌来源:`GET /api/device/login`(扫码登录,见 `app/controller/device/auth.js`)。 + */ +class DeviceSelfController extends Controller { + /** + * GET /api/scanner/me —— 当前设备信息 + * 需要长期 JWT(Authorization: Bearer ,见 app/middleware/scanner_auth.js) + */ + async me() { + const { ctx } = this; + const data = await ctx.service.scanner.findById(ctx.state.scanner.id); + ctx.body = { ok: true, data }; + } + + /** + * POST /api/scanner/heartbeat —— 设备心跳(需 JWT) + * 用于设备与服务之间的连通性保活,同时刷新 IP 与心跳时间 + */ + async heartbeat() { + const { ctx } = this; + const data = await ctx.service.scanner.heartbeat(ctx.state.scanner, ctx.ip); + ctx.body = { + ok: true, + data: { + sn: data.sn, + lastSeenAt: data.lastSeenAt, + serverTime: new Date().toISOString(), + }, + }; + } +} + +module.exports = DeviceSelfController; diff --git a/backend/app/controller/health.js b/backend/app/controller/health.js new file mode 100644 index 0000000..03f8ccf --- /dev/null +++ b/backend/app/controller/health.js @@ -0,0 +1,28 @@ +'use strict'; + +const { Controller } = require('egg'); + +class HealthController extends Controller { + /** + * GET /health + * 同时探测 MySQL 与 Redis,任一不可用则返回 503 + */ + async index() { + const { ctx, app } = this; + const [ mysql, redis ] = await Promise.all([ + ctx.service.health.checkMysql(), + ctx.service.health.checkRedis(), + ]); + + const ok = mysql.ok && redis.ok; + ctx.status = ok ? 200 : 503; + ctx.body = { + ok, + env: app.config.env, + uptime: Math.round(process.uptime()), + dependencies: { mysql, redis }, + }; + } +} + +module.exports = HealthController; diff --git a/backend/app/controller/home.js b/backend/app/controller/home.js new file mode 100644 index 0000000..29db55e --- /dev/null +++ b/backend/app/controller/home.js @@ -0,0 +1,18 @@ +'use strict'; + +const { Controller } = require('egg'); + +class HomeController extends Controller { + async index() { + const { ctx, app } = this; + ctx.body = { + ok: true, + name: app.config.name, + env: app.config.env, + uptime: Math.round(process.uptime()), + node: process.version, + }; + } +} + +module.exports = HomeController; diff --git a/backend/app/controller/internal/config.js b/backend/app/controller/internal/config.js new file mode 100644 index 0000000..63b452a --- /dev/null +++ b/backend/app/controller/internal/config.js @@ -0,0 +1,67 @@ +'use strict'; + +const { Controller } = require('egg'); + +/** + * 运维/内部:系统配置(sys_config)读写 + * + * 挂在 `middleware.internalAuth()` 后面;读接口带 Redis 缓存,写接口自动失效。 + */ +class InternalConfigController extends Controller { + /** GET /api/configs?group=wechat —— 列表(管理用,含禁用项) */ + async index() { + const { ctx } = this; + const list = await ctx.service.config.list({ groupName: ctx.query.group }); + ctx.body = { ok: true, data: { list, total: list.length } }; + } + + /** GET /api/configs/:group/:key —— 取单个配置值(带 Redis 缓存) */ + async show() { + const { ctx } = this; + const { group, key } = ctx.params; + const value = await ctx.service.config.get(group, key); + if (value === null) { + ctx.status = 404; + ctx.body = { ok: false, message: '配置不存在' }; + return; + } + ctx.body = { ok: true, data: { group, key, value } }; + } + + /** GET /api/configs/:group —— 取一个分组的所有启用配置 */ + async showGroup() { + const { ctx } = this; + const { group } = ctx.params; + const data = await ctx.service.config.getGroup(group); + ctx.body = { ok: true, data }; + } + + /** PUT /api/configs —— 新增或更新(幂等) */ + async upsert() { + const { ctx } = this; + const { configKey } = ctx.request.body || {}; + if (!configKey) { + ctx.status = 422; + ctx.body = { ok: false, message: 'configKey 不能为空' }; + return; + } + + const data = await ctx.service.config.set(ctx.request.body); + ctx.body = { ok: true, data }; + } + + /** DELETE /api/configs/:group/:key —— 软删除 */ + async destroy() { + const { ctx } = this; + const { group, key } = ctx.params; + const removed = await ctx.service.config.remove(group, key); + if (!removed) { + ctx.status = 404; + ctx.body = { ok: false, message: '配置不存在' }; + return; + } + ctx.body = { ok: true, data: { group, key } }; + } +} + +module.exports = InternalConfigController; diff --git a/backend/app/controller/internal/device.js b/backend/app/controller/internal/device.js new file mode 100644 index 0000000..80fc0f6 --- /dev/null +++ b/backend/app/controller/internal/device.js @@ -0,0 +1,99 @@ +'use strict'; + +const { Controller } = require('egg'); + +/** 路径参数转正整数,非法返回 null */ +function toId(value) { + const id = Number(value); + return Number.isInteger(id) && id > 0 ? id : null; +} + +/** + * 运维/内部:设备(scanners)的绑定 / 解绑 / 列表 / 详情 / 删除 + * + * 面向:运维脚本、后台系统 —— 可看/可管**所有人**的设备,所以挂在 `middleware.internalAuth()` 后面。 + * 前端 SPA 只能管自己的设备:`/api/web/devices*`(见 controller/web/device.js)。 + * + * 设备侧的部分在 `app/controller/device/`(扫码登录 `auth.js`、自检保活 `self.js`、上报 `scan.js`)。 + */ +class InternalDeviceController extends Controller { + /** + * POST /api/scanner/bind —— 把设备绑定到账号(**管理侧**接口,不是设备自己调的) + * 设备自己的注册/登录全部走扫码登录:`GET /api/device/login` + */ + async bind() { + const { ctx } = this; + const body = ctx.request.body || {}; + const data = await ctx.service.scanner.bind({ + scannerId: toId(body.scannerId), + sn: body.sn, + userId: body.userId, + username: body.username, + }); + ctx.body = { ok: true, data }; + } + + /** POST /api/scanner/unbind —— 解绑(设备保留,仅清掉归属;设备可再扫码重新认领) */ + async unbind() { + const { ctx } = this; + const body = ctx.request.body || {}; + const data = await ctx.service.scanner.unbind({ + scannerId: toId(body.scannerId), + sn: body.sn, + }); + if (!data) { + ctx.status = 404; + ctx.body = { ok: false, message: '扫描器不存在' }; + return; + } + ctx.body = { ok: true, data }; + } + + /** GET /api/scanners?page=&pageSize=&keyword=&userId=&status= —— 设备列表 */ + async index() { + const { ctx } = this; + const { page, pageSize, keyword, userId, status } = ctx.query; + const data = await ctx.service.scanner.list({ page, pageSize, keyword, userId, status }); + ctx.body = { ok: true, data }; + } + + /** GET /api/scanners/:id —— 设备详情 */ + async show() { + const { ctx } = this; + const id = toId(ctx.params.id); + if (!id) { + ctx.status = 400; + ctx.body = { ok: false, message: 'id 必须是正整数' }; + return; + } + + const data = await ctx.service.scanner.findById(id); + if (!data) { + ctx.status = 404; + ctx.body = { ok: false, message: '扫描器不存在' }; + return; + } + ctx.body = { ok: true, data }; + } + + /** DELETE /api/scanners/:id —— 软删除设备 */ + async destroy() { + const { ctx } = this; + const id = toId(ctx.params.id); + if (!id) { + ctx.status = 400; + ctx.body = { ok: false, message: 'id 必须是正整数' }; + return; + } + + const removed = await ctx.service.scanner.remove(id); + if (!removed) { + ctx.status = 404; + ctx.body = { ok: false, message: '扫描器不存在' }; + return; + } + ctx.body = { ok: true, data: { id } }; + } +} + +module.exports = InternalDeviceController; diff --git a/backend/app/controller/internal/user.js b/backend/app/controller/internal/user.js new file mode 100644 index 0000000..29f803f --- /dev/null +++ b/backend/app/controller/internal/user.js @@ -0,0 +1,108 @@ +'use strict'; + +const { Controller } = require('egg'); + +/** 路径参数转正整数,非法返回 null */ +function toId(value) { + const id = Number(value); + return Number.isInteger(id) && id > 0 ? id : null; +} + +/** + * 运维/内部:用户 CRUD(能看/改**所有**账号,所以挂在 `middleware.internalAuth()` 后面) + * + * 面向:运维脚本、后台系统。前端 SPA 用的是 `/api/web/*`(只能动自己的东西)。 + */ +class InternalUserController extends Controller { + /** GET /api/users?page=1&pageSize=20&keyword=&status= */ + async index() { + const { ctx } = this; + const { page, pageSize, keyword, status } = ctx.query; + const data = await ctx.service.user.list({ page, pageSize, keyword, status }); + ctx.body = { ok: true, data }; + } + + /** GET /api/users/:id —— 走 Redis 缓存,未命中回源数据库 */ + async show() { + const { ctx } = this; + const id = toId(ctx.params.id); + if (!id) { + ctx.status = 400; + ctx.body = { ok: false, message: 'id 必须是正整数' }; + return; + } + + const user = await ctx.service.cache.remember( + `user:${id}`, + ctx.app.config.cache.ttl, + () => ctx.service.user.findById(id), + ); + + if (!user) { + ctx.status = 404; + ctx.body = { ok: false, message: '用户不存在' }; + return; + } + ctx.body = { ok: true, data: user }; + } + + /** POST /api/users */ + async create() { + const { ctx } = this; + const body = ctx.request.body || {}; + if (!body.nickname) { + ctx.status = 422; + ctx.body = { ok: false, message: 'nickname 不能为空' }; + return; + } + + const user = await ctx.service.user.create(body); + ctx.status = 201; + ctx.body = { ok: true, data: user }; + } + + /** PUT /api/users/:id */ + async update() { + const { ctx } = this; + const id = toId(ctx.params.id); + if (!id) { + ctx.status = 400; + ctx.body = { ok: false, message: 'id 必须是正整数' }; + return; + } + + const user = await ctx.service.user.update(id, ctx.request.body || {}); + if (!user) { + ctx.status = 404; + ctx.body = { ok: false, message: '用户不存在' }; + return; + } + + // 数据变更后让缓存失效 + await ctx.service.cache.del(`user:${id}`); + ctx.body = { ok: true, data: user }; + } + + /** DELETE /api/users/:id —— 软删除 */ + async destroy() { + const { ctx } = this; + const id = toId(ctx.params.id); + if (!id) { + ctx.status = 400; + ctx.body = { ok: false, message: 'id 必须是正整数' }; + return; + } + + const removed = await ctx.service.user.remove(id); + if (!removed) { + ctx.status = 404; + ctx.body = { ok: false, message: '用户不存在' }; + return; + } + + await ctx.service.cache.del(`user:${id}`); + ctx.body = { ok: true, data: { id } }; + } +} + +module.exports = InternalUserController; diff --git a/backend/app/controller/internal/wechat.js b/backend/app/controller/internal/wechat.js new file mode 100644 index 0000000..16b0537 --- /dev/null +++ b/backend/app/controller/internal/wechat.js @@ -0,0 +1,95 @@ +'use strict'; + +const { Controller } = require('egg'); + +/** + * 运维/内部:微信授权(绑定关系)的读写 + * + * 挂在 `middleware.internalAuth()` 后面(见 app/middleware/internal_auth.js)。 + * + * 用户侧的扫码确认在 `app/controller/client/wechat.js`,公开的发码/查码在 `app/controller/auth/wechat.js`。 + */ +class InternalWechatController extends Controller { + /** GET /api/users/:id/wechats —— 某用户的全部微信授权 */ + async indexByUser() { + const { ctx } = this; + const userId = Number(ctx.params.id); + if (!Number.isInteger(userId) || userId <= 0) { + ctx.status = 400; + ctx.body = { ok: false, message: 'id 必须是正整数' }; + return; + } + + const list = await ctx.service.wechat.listByUser(userId); + ctx.body = { ok: true, data: { list, total: list.length } }; + } + + /** GET /api/wechat/:appid/:openid —— 按 appid + openid 反查授权与用户 */ + async show() { + const { ctx } = this; + const { appid, openid } = ctx.params; + const data = await ctx.service.wechat.findByOpenid(appid, openid); + if (!data) { + ctx.status = 404; + ctx.body = { ok: false, message: '授权记录不存在' }; + return; + } + ctx.body = { ok: true, data }; + } + + /** POST /api/wechat/bind —— 绑定(已存在则更新) */ + async bind() { + const { ctx } = this; + const { userId, appid, openid } = ctx.request.body || {}; + + if (!userId || !appid || !openid) { + ctx.status = 422; + ctx.body = { ok: false, message: 'userId、appid、openid 均为必填' }; + return; + } + + const data = await ctx.service.wechat.bind(ctx.request.body); + ctx.status = 201; + ctx.body = { ok: true, data }; + } + + /** PUT /api/wechat/:id/tokens —— 更新 session_key / 令牌 */ + async updateTokens() { + const { ctx } = this; + const id = Number(ctx.params.id); + if (!Number.isInteger(id) || id <= 0) { + ctx.status = 400; + ctx.body = { ok: false, message: 'id 必须是正整数' }; + return; + } + + const data = await ctx.service.wechat.updateTokens(id, ctx.request.body || {}); + if (!data) { + ctx.status = 404; + ctx.body = { ok: false, message: '授权记录不存在' }; + return; + } + ctx.body = { ok: true, data }; + } + + /** DELETE /api/wechat/:id —— 解绑 */ + async unbind() { + const { ctx } = this; + const id = Number(ctx.params.id); + if (!Number.isInteger(id) || id <= 0) { + ctx.status = 400; + ctx.body = { ok: false, message: 'id 必须是正整数' }; + return; + } + + const removed = await ctx.service.wechat.unbind(id); + if (!removed) { + ctx.status = 404; + ctx.body = { ok: false, message: '授权记录不存在' }; + return; + } + ctx.body = { ok: true, data: { id } }; + } +} + +module.exports = InternalWechatController; diff --git a/backend/app/controller/web/auth.js b/backend/app/controller/web/auth.js new file mode 100644 index 0000000..7a0662e --- /dev/null +++ b/backend/app/controller/web/auth.js @@ -0,0 +1,187 @@ +'use strict'; + +const { Controller } = require('egg'); + +/** 邮箱格式(与页面版保持一致,宽松校验) */ +const EMAIL_RE = /^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/; + +/** + * web 用户端:登录 / 注册 / 找回密码 / 重置密码(**JSON 接口**,给前端 SPA 调) + * + * 鉴权走 **header 令牌**(`Authorization: Bearer `),不依赖 cookie/session: + * 前端与后端不同源也没问题,也天然不受 CSRF 影响(`/api/*` 不过 CSRF)。 + * + * 统一响应:成功 `{ ok:true, data }`;失败 `{ ok:false, status?, message }`。 + */ +class WebAuthController extends Controller { + /** 签发令牌 + 返回脱敏用户(登录 / 注册成功后都走它) */ + issue(user) { + const { ctx } = this; + return { + token: ctx.service.jwt.signUser(user), + tokenType: 'Bearer', + expiresIn: ctx.app.config.jwt.userExpiresIn, + user, + }; + } + + /** + * POST /api/web/auth/login + * body: `{ account, password }`(account 支持 用户名 / 手机号 / 邮箱) + * → `{ token, tokenType, expiresIn, user }` + */ + async login() { + const { ctx } = this; + const { account, password } = ctx.request.body || {}; + if (!account || !password) { + ctx.status = 422; + ctx.body = { ok: false, message: '请填写账号和密码' }; + return; + } + + const user = await ctx.service.auth.login(String(account).trim(), password); + if (!user) { + ctx.status = 401; + ctx.body = { ok: false, status: 'unauthorized', message: '账号或密码错误' }; + return; + } + + ctx.logger.info('[web] %s 登录成功(API)', user.username || account); + ctx.body = { ok: true, data: this.issue(user) }; + } + + /** + * POST /api/web/auth/register/code + * body: `{ email }` → 发 6 位邮箱验证码(开发模式直接返回 `code`) + */ + async sendRegisterCode() { + const { ctx } = this; + const email = String((ctx.request.body || {}).email || '').trim().toLowerCase(); + + if (!ctx.app.config.register.enable) { + ctx.throw(403, '注册已关闭,请联系管理员开通账号'); + } + if (!EMAIL_RE.test(email)) { + ctx.throw(422, '请填写正确的邮箱'); + } + + const exists = await ctx.service.user.findOneBy({ email }); + if (exists) ctx.throw(409, '该邮箱已被使用'); + + const result = await ctx.service.verifyCode.send('register', email); + if (!result.ok) ctx.throw(429, result.message); + + ctx.logger.info('[web] 注册验证码已发送到 %s', email); + ctx.body = { + ok: true, + data: { + email, + // 开发模式(未配 SMTP)把验证码带回来,前端可直接提示;生产不返回 + devMode: Boolean(result.devMode), + code: result.devMode ? result.code : undefined, + }, + }; + } + + /** + * POST /api/web/auth/register + * body: `{ username, email, code, password, nickname?, phone? }` → 建成即登录(返回令牌) + */ + async register() { + const { ctx } = this; + const body = ctx.request.body || {}; + const username = String(body.username || '').trim(); + const email = String(body.email || '').trim().toLowerCase(); + const code = String(body.code || '').trim(); + const password = String(body.password || ''); + const nickname = String(body.nickname || '').trim(); + const phone = String(body.phone || '').trim(); + + if (!ctx.app.config.register.enable) ctx.throw(403, '注册已关闭,请联系管理员开通账号'); + if (!/^[A-Za-z0-9_]{3,32}$/.test(username)) ctx.throw(422, '用户名需 3-32 位字母、数字或下划线'); + if (!EMAIL_RE.test(email)) ctx.throw(422, '邮箱格式不正确'); + if (!/^\d{6}$/.test(code)) ctx.throw(422, '请填写 6 位邮箱验证码'); + if (password.length < 6) ctx.throw(422, '密码至少 6 位'); + if (phone && !/^[0-9+\-]{6,20}$/.test(phone)) ctx.throw(422, '手机号格式不正确'); + + const checked = await ctx.service.verifyCode.check('register', email, code); + if (!checked.ok) ctx.throw(422, checked.message); + + try { + const user = await ctx.service.auth.register({ username, password, nickname, email, phone: phone || null }); + // 注册成功才消费验证码(用户名/邮箱冲突时可改完重提,不用重新收码) + await ctx.service.verifyCode.consume('register', email); + ctx.logger.info('[web] %s 注册成功(API,id=%s)', username, user.id); + ctx.body = { ok: true, data: this.issue(user) }; + } catch (err) { + // 唯一键冲突(409):翻成页面能直接显示的文案 + if (err.status === 409) { + const message = String(err.message || ''); + ctx.status = 409; + ctx.body = { + ok: false, + message: message.startsWith('username') ? '该用户名已被使用' + : message.startsWith('email') ? '该邮箱已被使用' + : message.startsWith('phone') ? '该手机号已被注册' + : '注册失败,请稍后重试', + }; + return; + } + throw err; + } + } + + /** + * POST /api/web/auth/forgot + * body: `{ email }` → 发重置链接(**防账号枚举**:邮箱没注册也返回成功) + */ + async forgot() { + const { ctx } = this; + const email = String((ctx.request.body || {}).email || '').trim().toLowerCase(); + if (!EMAIL_RE.test(email)) ctx.throw(422, '请填写正确的邮箱'); + + const user = await ctx.service.user.findOneBy({ email }); + if (user && Number(user.status) === 1) { + const origin = ctx.app.config.email.siteUrl || ctx.origin; + const result = await ctx.service.passwordReset.send(user, origin); + if (!result.ok) ctx.throw(500, result.message); + + ctx.logger.info('[web] 已向 %s 发送重置密码链接', email); + ctx.body = { + ok: true, + data: { + sent: true, + // 开发模式(未配 SMTP)把链接返回,前端可直接点开 + devMode: Boolean(result.devMode), + url: result.devMode ? result.url : undefined, + }, + }; + return; + } + + if (user) ctx.logger.warn('[web] 账号已禁用,不发送重置链接: %s', email); + ctx.body = { ok: true, data: { sent: true } }; + } + + /** + * POST /api/web/auth/reset + * body: `{ token, password }` → 用邮件里的令牌设新密码(令牌一次性) + */ + async reset() { + const { ctx } = this; + const body = ctx.request.body || {}; + const token = String(body.token || ''); + const password = String(body.password || ''); + + const userId = await ctx.service.passwordReset.verify(token); + if (!userId) ctx.throw(410, '重置链接无效或已过期,请重新获取'); + if (password.length < 6) ctx.throw(422, '密码至少 6 位'); + + await ctx.service.auth.setPassword(userId, password); + await ctx.service.passwordReset.consume(token, userId); + ctx.logger.info('[web] 用户 %s 通过邮件链接重置了密码(API)', userId); + ctx.body = { ok: true, data: { id: userId } }; + } +} + +module.exports = WebAuthController; diff --git a/backend/app/controller/web/device.js b/backend/app/controller/web/device.js new file mode 100644 index 0000000..bbcf756 --- /dev/null +++ b/backend/app/controller/web/device.js @@ -0,0 +1,82 @@ +'use strict'; + +const { Controller } = require('egg'); + +/** 路径参数转正整数,非法返回 null */ +function toId(value) { + const id = Number(value); + return Number.isInteger(id) && id > 0 ? id : null; +} + +/** + * web 用户端:**我自己的设备**(`/api/web/devices`) + * + * 鉴权:`middleware.apiAuth()`(header 里的 user JWT),用户 ID 一律取自令牌。 + * 与 `controller/internal/device.js` 的区别:那边是运维视角(可看/可管**所有人**的设备), + * 这边只能看/动自己的 —— 不属于自己的设备直接 404(不暴露别人有哪些设备)。 + */ +class WebDeviceController extends Controller { + /** 取「我的设备」;不是自己的(或不存在)一律 404 */ + async own(rawId) { + const { ctx } = this; + const id = toId(rawId); + if (!id) ctx.throw(400, 'id 必须是正整数'); + + const data = await ctx.service.scanner.findById(id); + if (!data || Number(data.userId) !== Number(ctx.state.user.id)) { + ctx.throw(404, '设备不存在或不属于当前账号'); + } + return data; + } + + /** GET /api/web/devices?page=&pageSize=&keyword=&status= —— 我的设备列表 */ + async index() { + const { ctx } = this; + const { page, pageSize, keyword, status } = ctx.query; + const data = await ctx.service.scanner.list({ + page, + pageSize, + keyword, + status, + // ⚠️ 强制按当前用户过滤,忽略前端传的 userId + userId: ctx.state.user.id, + }); + ctx.body = { ok: true, data }; + } + + /** GET /api/web/devices/:id —— 设备详情 */ + async show() { + const { ctx } = this; + ctx.body = { ok: true, data: await this.own(ctx.params.id) }; + } + + /** GET /api/web/devices/:id/channels —— 该设备(中控)下已登记的通道 */ + async channels() { + const { ctx } = this; + const device = await this.own(ctx.params.id); + const list = await ctx.service.scan.findChannelsByScanner(device.id); + ctx.body = { ok: true, data: { deviceId: device.id, list } }; + } + + /** POST /api/web/devices/:id/unbind —— 解绑(记录保留,设备可再扫码认领) */ + async unbind() { + const { ctx } = this; + const device = await this.own(ctx.params.id); + const data = await ctx.service.scanner.unbind({ scannerId: device.id }); + + ctx.logger.info('[web] 用户 %s 解绑了设备 %s', ctx.state.user.id, device.sn); + ctx.body = { ok: true, data }; + } + + /** DELETE /api/web/devices/:id —— 删除(软删除)自己的设备 */ + async destroy() { + const { ctx } = this; + const device = await this.own(ctx.params.id); + await ctx.service.scanner.remove(device.id); + + ctx.logger.info('[web] 用户 %s 删除了设备 %s', ctx.state.user.id, device.sn); + ctx.body = { ok: true, data: { id: device.id } }; + } +} + +module.exports = WebDeviceController; diff --git a/backend/app/controller/web/profile.js b/backend/app/controller/web/profile.js new file mode 100644 index 0000000..8651818 --- /dev/null +++ b/backend/app/controller/web/profile.js @@ -0,0 +1,65 @@ +'use strict'; + +const { Controller } = require('egg'); + +/** 只允许这几个字段由用户自己改(用户名、状态这类不给改) */ +const EDITABLE = [ 'nickname', 'avatar', 'phone', 'gender', 'email' ]; + +/** + * web 用户端:当前用户自己的资料(`/api/web/me`) + * + * 鉴权:`middleware.apiAuth()` —— header 里的 user JWT;**用户 ID 一律取自令牌**, + * 不接受前端传 id(不然就成越权改别人资料了)。 + */ +class WebProfileController extends Controller { + /** GET /api/web/me —— 当前登录用户 */ + async show() { + const { ctx } = this; + ctx.body = { ok: true, data: ctx.state.user }; + } + + /** + * PUT /api/web/me —— 改自己的资料 + * body: `{ nickname?, avatar?, phone?, gender?, email? }` + */ + async update() { + const { ctx } = this; + const body = ctx.request.body || {}; + const fields = {}; + for (const key of EDITABLE) { + if (body[key] !== undefined) fields[key] = body[key]; + } + if (!Object.keys(fields).length) ctx.throw(422, '没有可更新的字段'); + if (fields.email !== undefined) { + fields.email = String(fields.email || '').trim().toLowerCase() || null; + } + if (fields.nickname !== undefined && !String(fields.nickname).trim()) { + ctx.throw(422, '昵称不能为空'); + } + + const user = await ctx.service.user.update(ctx.state.user.id, fields); + // 用户详情接口用的是同一份缓存,顺手失效 + await ctx.service.cache.del(`user:${ctx.state.user.id}`); + ctx.logger.info('[web] 用户 %s 更新了资料', ctx.state.user.id); + ctx.body = { ok: true, data: user }; + } + + /** + * PUT /api/web/me/password —— 修改密码 + * body: `{ oldPassword, newPassword }` + */ + async changePassword() { + const { ctx } = this; + const { oldPassword, newPassword } = ctx.request.body || {}; + if (!oldPassword || !newPassword) ctx.throw(422, '请填写原密码与新密码'); + if (String(newPassword).length < 6) ctx.throw(422, '新密码至少 6 位'); + + const changed = await ctx.service.auth.changePassword(ctx.state.user.id, oldPassword, newPassword); + if (!changed) ctx.throw(422, '原密码不正确'); + + ctx.logger.info('[web] 用户 %s 修改了密码', ctx.state.user.id); + ctx.body = { ok: true, data: { id: ctx.state.user.id } }; + } +} + +module.exports = WebProfileController; diff --git a/backend/app/controller/web/record.js b/backend/app/controller/web/record.js new file mode 100644 index 0000000..48d2d53 --- /dev/null +++ b/backend/app/controller/web/record.js @@ -0,0 +1,48 @@ +'use strict'; + +const { Controller } = require('egg'); + +/** + * web 用户端:**我自己设备的扫码记录**(`/api/web/records`) + * + * 鉴权:`middleware.apiAuth()`;范围限定为「当前用户名下的设备」—— + * 先取我的设备 id 列表,再拿它去过滤记录(`service.scan.listRecords({ scannerIds })`)。 + */ +class WebRecordController extends Controller { + /** + * GET /api/web/records + * query: `?page=&pageSize=&deviceId=&channelId=&barcode=&startTime=&endTime=` + * - `deviceId` 只能填自己名下的设备(否则 404);不填 = 所有设备 + * - `startTime` / `endTime` 支持 `2026-10-16 12:00:00`、10/13 位时间戳 + */ + async index() { + const { ctx } = this; + const { page, pageSize, deviceId, channelId, barcode, startTime, endTime } = ctx.query; + + const ids = await ctx.service.scanner.idsOfUser(ctx.state.user.id); + let scannerIds = ids; + if (deviceId) { + const id = Number(deviceId); + if (!ids.includes(id)) ctx.throw(404, '设备不存在或不属于当前账号'); + scannerIds = [ id ]; + } + + const data = await ctx.service.scan.listRecords({ + page, pageSize, scannerIds, channelId, barcode, startTime, endTime, + }); + + ctx.body = { + ok: true, + data: Object.assign({}, data, { + // 拍平所属设备(前端表格直接显示),免得前端再查一次 + list: data.list.map(row => Object.assign({}, row, { + deviceSn: row.scanner ? row.scanner.sn : null, + deviceName: row.scanner ? row.scanner.name : null, + scanner: undefined, + })), + }), + }; + } +} + +module.exports = WebRecordController; diff --git a/backend/app/controller/web/stats.js b/backend/app/controller/web/stats.js new file mode 100644 index 0000000..19446e4 --- /dev/null +++ b/backend/app/controller/web/stats.js @@ -0,0 +1,44 @@ +'use strict'; + +const { Controller } = require('egg'); + +/** + * web 用户端:首页统计(`/api/web/stats`) + * + * 只统计**当前用户名下**的数据(设备数 / 通道数 / 扫码记录数 + 最近一条扫码记录), + * 与运维视角的统计(`service.user.count()` 那种全站数字)区分开。 + */ +class WebStatsController extends Controller { + /** GET /api/web/stats */ + async index() { + const { ctx } = this; + const userId = ctx.state.user.id; + const ids = await ctx.service.scanner.idsOfUser(userId); + + const [ deviceCount, channelCount, recordCount, latest ] = await Promise.all([ + ctx.service.scanner.count({ userId }), + ctx.service.scan.countChannels({ scannerIds: ids }), + ctx.service.scan.countRecords({ scannerIds: ids }), + ctx.service.scan.listRecords({ scannerIds: ids, page: 1, pageSize: 1 }), + ]); + + const row = latest.list[0] || null; + ctx.body = { + ok: true, + data: { + deviceCount, + channelCount, + recordCount, + latestRecord: row ? { + id: row.id, + barcode: row.barcode, + channelId: row.channelId, + deviceSn: row.scanner ? row.scanner.sn : null, + scanTime: row.scanTime, + } : null, + }, + }; + } +} + +module.exports = WebStatsController; diff --git a/backend/app/controller/web/test.js b/backend/app/controller/web/test.js new file mode 100644 index 0000000..dab3474 --- /dev/null +++ b/backend/app/controller/web/test.js @@ -0,0 +1,111 @@ +'use strict'; + +const { Controller } = require('egg'); + +/** + * web 用户端:**测试页**用的模拟接口(`/api/web/test/*`) + * + * 前端「测试页」把真机链路拆开跑,方便没有实物设备时联调: + * - `POST /api/web/test/device-login`:模拟「设备发码 → 有人扫码确认」这一步。 + * 请求方(已登录用户)就是**确认人**,等价于手机上点了确认 —— 会真的建/认领设备记录并**换发长期 JWT**。 + * - `POST /api/web/test/scan`:模拟「中控上报」(拿 SN + 长期 JWT 调,等价于设备的 `/api/scan/*`)。 + * + * 两者都不绕开校验:设备令牌仍按 `service.scanner.resolveByToken()` 完整验签 + 比对 jti。 + */ +class WebTestController extends Controller { + /** + * POST /api/web/test/device-login + * body: `{ sn?, name?, vendor?, model?, firmware?, expiresIn? }` + * → `{ ...设备信息, token, tokenType, firstTime }` + */ + async deviceLogin() { + const { ctx } = this; + const body = ctx.request.body || {}; + const expiresIn = this.resolveDuration(body.expiresIn); + + const created = await ctx.service.scanner.loginByScan({ + sn: body.sn, + name: body.name, + vendor: body.vendor, + model: body.model, + firmware: body.firmware, + ip: ctx.ip, + userId: ctx.state.user.id, + expiresIn, + }); + + // 再查一次,拿到带绑定用户信息的完整数据 + const detail = await ctx.service.scanner.findById(created.id); + ctx.logger.info('[web-test] 模拟设备扫码登录: %s(确认人 %s)', created.sn, ctx.state.user.id); + + ctx.body = { + ok: true, + data: Object.assign({}, detail, { + token: created.token, + tokenType: created.tokenType, + firstTime: created.firstTime, + }), + }; + } + + /** + * 令牌时长(可选):只能申请比 `config.jwt.deviceExpiresIn` 更短的,超上限 422 + * @return {number|undefined} 秒数;没传返回 undefined(用默认值) + */ + resolveDuration(raw) { + const { ctx } = this; + const value = String(raw || '').trim(); + if (!value) return undefined; + + const { jwt } = ctx.app.config; + const maxSpec = String(jwt.deviceExpiresIn || jwt.scannerExpiresIn || '365d'); + const max = ctx.service.jwt.parseDuration(maxSpec); + const seconds = ctx.service.jwt.parseDuration(value); + + if (!seconds) ctx.throw(422, 'expiresIn 格式不对(支持 30d / 12h / 90m / 3600 这类写法)'); + if (max && seconds > max) ctx.throw(422, `expiresIn 不能超过服务端上限 ${maxSpec}`); + return seconds; + } + + /** + * POST /api/web/test/scan + * body: `{ sn, token, channelId, channelName?, barcode, scanTime? }` + * → `{ inserted, duplicated, ... }`(与设备上报同结构) + */ + async scan() { + const { ctx } = this; + const body = ctx.request.body || {}; + const sn = String(body.sn || '').trim(); + const token = String(body.token || '').trim(); + const channelId = String(body.channelId || '').trim(); + const channelName = String(body.channelName || '').trim(); + const barcode = String(body.barcode || '').trim(); + const scanTime = String(body.scanTime || '').trim(); + + if (!sn || !token) ctx.throw(422, '设备 SN 与长期 JWT 都不能为空'); + if (!channelId) ctx.throw(422, '通道 id 不能为空'); + if (!barcode) ctx.throw(422, '条码不能为空'); + + // 与设备上报走**同一套**校验(验签 + 回查 + jti 比对) + const scanner = await ctx.service.scanner.resolveByToken(token, { sn }); + await ctx.service.scanner.heartbeat(scanner, ctx.ip); + + const channelResult = await ctx.service.scan.reportChannels(scanner, [{ channelId, channelName }]); + const scanResult = await ctx.service.scan.ingest(scanner, [{ + channelId, + barcode, + scanTime: scanTime || new Date(), + }]); + + ctx.logger.info('[web-test] 模拟上报完成: %s 通道=%s 条码=%s', sn, channelId, barcode); + ctx.body = { + ok: true, + data: Object.assign({ sn, channelId, channelName, barcode }, scanResult, { + channelCreated: channelResult.created, + channelUpdated: channelResult.updated, + }), + }; + } +} + +module.exports = WebTestController; diff --git a/backend/app/middleware/api_auth.js b/backend/app/middleware/api_auth.js new file mode 100644 index 0000000..e8b6f5e --- /dev/null +++ b/backend/app/middleware/api_auth.js @@ -0,0 +1,56 @@ +'use strict'; + +/** + * 接口鉴权(**只认 header 里的令牌,不看 cookie/session**) + * + * 用法:`router.post('/api/xxx', middleware.apiAuth(), controller.xxx.yyy)` + * + * - 令牌:`Authorization: Bearer `(也认 `X-Access-Token`,方便不爱用 Authorization 的客户端) + * JWT 由这些地方下发:扫码登录 `GET /api/wechat/login` 的 `data.token`、页面里现场签发的同款令牌; + * - 不加 cookie、也不写 session:小程序 / App / SPA 这类没有浏览器 cookie 的客户端直接用它; + * - 未带或验不过 → 401 `{ ok:false, status:'unauthorized', message }`; + * 用户不存在/被禁用 → 403 `{ ok:false, status:'forbidden', message }`; + * - 通过后把用户放进 `ctx.locals.user` 与 `ctx.state.user`。 + */ +module.exports = () => { + return async function apiAuth(ctx, next) { + const token = bearerToken(ctx); + + const payload = token && ctx.service.jwt.verifyUser(token); + const userId = payload && payload.sub ? Number(payload.sub) : 0; + if (!userId) { + ctx.status = 401; + ctx.body = { + ok: false, + status: 'unauthorized', + message: '缺少或无效的令牌(请在 header 里带 Authorization: Bearer )', + }; + return; + } + + const user = await ctx.service.user.findById(userId); + if (!user) { + ctx.status = 401; + ctx.body = { ok: false, status: 'unauthorized', message: '令牌对应的用户不存在' }; + return; + } + if (Number(user.status) !== 1) { + ctx.status = 403; + ctx.body = { ok: false, status: 'forbidden', message: '账号已被禁用' }; + return; + } + + // 注意:**不碰 session/cookie**,接口鉴权完全基于这一次请求的 header + ctx.locals = ctx.locals || {}; + ctx.locals.user = user; + ctx.state.user = user; + await next(); + }; +}; + +/** 取 header 里的令牌:优先 Authorization: Bearer,其次 X-Access-Token */ +function bearerToken(ctx) { + const matched = /^Bearer\s+(.+)$/i.exec(ctx.get('authorization') || ''); + if (matched) return matched[1].trim(); + return String(ctx.get('x-access-token') || '').trim(); +} diff --git a/backend/app/middleware/error_handler.js b/backend/app/middleware/error_handler.js new file mode 100644 index 0000000..a397b49 --- /dev/null +++ b/backend/app/middleware/error_handler.js @@ -0,0 +1,52 @@ +'use strict'; + +/** + * 统一错误处理(后端不再渲染页面 → 只会返回 JSON 或纯文本) + * + * - 接口请求(`/api/*`、`/health` 或声明了 Accept: application/json)→ `{ ok:false, message }` + * - 其它请求(正常都被 app/middleware/frontend.js 接走了)→ 一行纯文本 + * + * 4xx 返回原始消息,5xx 只对外返回「服务器内部错误」并记入 common-error.log。 + */ +module.exports = () => { + return async function errorHandler(ctx, next) { + try { + await next(); + + // 没匹配到任何路由的接口请求:框架/koa 默认回 HTML 404(客户端按 JSON 解析会报 + // `Unexpected token '<'`),这里统一成 JSON —— 控制器自己给的 404(对象 body)不动 + // ⚠️ 给 ctx.body 赋值会把「默认的 404」顶成 200,所以必须显式把状态码钉回 404 + const isApiPath = ctx.path.startsWith('/api/') || ctx.path === '/health'; + if (ctx.status === 404 && isApiPath && !(ctx.body && typeof ctx.body === 'object')) { + ctx.body = { ok: false, message: '接口不存在' }; + ctx.status = 404; + } + } catch (err) { + const status = err.status >= 400 && err.status < 600 ? err.status : 500; + + if (status >= 500) { + // 交给框架的 onerror 记录日志(common-error.log) + ctx.app.emit('error', err, ctx); + } else { + ctx.logger.warn('[http] %s %s -> %s %s', ctx.method, ctx.url, status, err.message); + } + + // 响应已经开始发送(例如已反代出去 / 流式输出)时不能再改 body + if (ctx.headerSent) return; + + const message = status >= 500 ? '服务器内部错误' : err.message; + // 接口请求返回 JSON,其它(理论上都被 frontend 中间件接走了)返回纯文本 + const isApi = ctx.path.startsWith('/api/') || ctx.path === '/health' || ctx.acceptJSON; + + ctx.status = status; + + if (isApi) { + ctx.body = { ok: false, message }; + return; + } + + ctx.type = 'text/plain; charset=utf-8'; + ctx.body = `${status} ${message}`; + } + }; +}; diff --git a/backend/app/middleware/frontend.js b/backend/app/middleware/frontend.js new file mode 100644 index 0000000..9cd2a47 --- /dev/null +++ b/backend/app/middleware/frontend.js @@ -0,0 +1,108 @@ +'use strict'; + +const fs = require('fs'); +const path = require('path'); +const httpProxy = require('http-proxy'); +const serve = require('koa-static'); + +/** + * 前端入口:**后端不再渲染任何页面**,`/` 这一侧要么反代给前端 dev server、要么托管前端构建产物 + * + * - **开发(`env=local`)**:把非 `/api`、`/health` 的请求反向代理到前端 dev server + * (`config.frontend.devServer`,默认 `http://127.0.0.1:7301`,即 `frontend && npm run dev`)。 + * 这样联调只开一个地址(后端 `:7001`),前端的热更新也照常生效(含 HMR 的 WebSocket 升级)。 + * - **生产**:托管 `config.frontend.distDir`(默认 `../frontend/dist`)里的静态资源, + * 找不到文件且浏览器要 HTML 时回退到 `index.html`(SPA 深链刷新不会 404)。 + * - **单测(`env=unittest`)**:整体跳过(不连前端、也不要求 dist 存在), + * 于是未匹配的路径还是走框架/路由自己的 404。 + * + * 只接管 GET/HEAD 的「非接口」请求:`/api/*`、`/health` 一律交给后面的路由。 + */ +module.exports = (options, app) => { + const cfg = app.config.frontend || {}; + const env = app.config.env; + const isDev = env === 'local'; + const enabled = Boolean(cfg.enable) && env !== 'unittest'; + + const distDir = cfg.distDir; + const indexFile = path.join(distDir, 'index.html'); + + // 静态中间件(生产用):只管真实文件,交给 koa-static 处理缓存/条件请求 + const staticMw = enabled && !isDev ? serve(distDir, { index: false, defer: false }) : null; + + if (enabled && isDev) { + app.logger.info('[frontend] dev 反代已启用: %s(页面请求转发给前端 dev server)', cfg.devServer); + + // 前端 dev server 的 HMR 走 WebSocket:HTTP server 的 upgrade 事件也得转过去, + // 否则页面能打开、但改代码不会热更新(升级请求没人管会直接断开) + app.once('server', server => { + server.on('upgrade', (req, socket, head) => { + const url = String(req.url || ''); + if (url.startsWith('/api/') || url === '/health') return; // 接口侧不接管 + getProxy(cfg.devServer).ws(req, socket, head, { target: cfg.devServer }); + }); + }); + } else if (enabled && staticMw) { + app.logger.info('[frontend] 静态托管已启用: %s(存在 index.html = %s)', distDir, fs.existsSync(indexFile)); + } + + return async function frontend(ctx, next) { + if (!enabled || !isFrontendRequest(ctx)) return next(); + + if (isDev) return proxyToDevServer(ctx, cfg.devServer); + + // 生产:先当静态资源找,找不到再回退 index.html(SPA 路由) + await staticMw(ctx, async () => {}); + if (ctx.status !== 404) return; + + if (!fs.existsSync(indexFile)) { + ctx.status = 503; + ctx.type = 'html'; + ctx.body = '

前端还没构建

请在 frontend/ 执行 npm run build(或用 FRONTEND_DIST 指定目录)。

'; + return; + } + + ctx.type = 'html'; + ctx.body = fs.createReadStream(indexFile); + }; +}; + +/** 只接管「页面」请求:非接口 + GET/HEAD */ +function isFrontendRequest(ctx) { + if (ctx.method !== 'GET' && ctx.method !== 'HEAD') return false; + return !ctx.path.startsWith('/api/') && ctx.path !== '/api' && ctx.path !== '/health'; +} + +/** 开发:反代到前端 dev server(含 HMR 的 WebSocket 升级) */ +function proxyToDevServer(ctx, target) { + // koa 不再自己写响应,完全交给反代 + ctx.respond = false; + + const proxy = getProxy(target); + proxy.web(ctx.req, ctx.res, { target }, (err) => { + if (ctx.res.headersSent) return; + ctx.status = 502; + ctx.type = 'html'; + ctx.body = `

前端 dev server 连不上

${err.message}

` + + `

请先启动前端:cd frontend; npm run dev(目标 ${target})

`; + }); +} + +/** 按 target 缓存代理实例(同一个 target 复用连接池) */ +const proxies = new Map(); +function getProxy(target) { + if (proxies.has(target)) return proxies.get(target); + + // ws: true —— 允许 `proxy.ws()` 把 HMR 的升级请求转过去 + const proxy = httpProxy.createProxyServer({ changeOrigin: true, xfwd: true, ws: true }); + proxy.on('error', (err, req, res) => { + // HTTP 请求的错误在 proxyToDevServer 的回调里处理;这里只兑底(避免 unhandled error 抛到进程) + if (res && !res.headersSent && res.writeHead) { + res.writeHead(502, { 'Content-Type': 'text/plain; charset=utf-8' }); + } + void err; + }); + + proxies.set(target, proxy); + return proxy; +} diff --git a/backend/app/middleware/internal_auth.js b/backend/app/middleware/internal_auth.js new file mode 100644 index 0000000..5c68489 --- /dev/null +++ b/backend/app/middleware/internal_auth.js @@ -0,0 +1,74 @@ +'use strict'; + +/** + * 运维/内部接口鉴权(`/api/users*`、`/api/wechat/bind`、`/api/configs*`、`/api/scanners*` 这些) + * + * 用法:`router.get('/api/users', middleware.internalAuth(), controller.internal.user.index)` + * + * 两种通过方式(满足其一即可): + * 1. **运维脚本 / 后台系统**:header 带 `X-Internal-Token: ` + * (环境变量 `INTERNAL_TOKEN`;**没配就一律不认**,避免线上忘记配还能进); + * 2. **管理员账号**:header 带 `Authorization: Bearer `,且 userId 在 + * `config.internal.adminIds`(环境变量 `INTERNAL_ADMIN_IDS`,逗号分隔,默认 `1`)里。 + * + * 通过后 `ctx.state.internal = { via, user? }`;不通过:401(没令牌/令牌无效)或 403(不是管理员、账号被禁用)。 + * + * ⚠️ 这是**内部接口**(能看/改所有人的数据)。前端 SPA 用的是 `/api/web/*`(只能动自己的东西), + * 不要把它暴露给普通用户。 + */ +module.exports = () => { + return async function internalAuth(ctx, next) { + const cfg = ctx.app.config.internal || {}; + + // ① 静态运维令牌(给脚本/后台系统用) + const internalToken = String(ctx.get('x-internal-token') || '').trim(); + if (cfg.token && internalToken && internalToken === cfg.token) { + ctx.state.internal = { via: 'token' }; + return next(); + } + + // ② 管理员账号的 user JWT + const bearer = bearerToken(ctx); + const payload = bearer && ctx.service.jwt.verifyUser(bearer); + const userId = payload && payload.sub ? Number(payload.sub) : 0; + + if (!userId) { + ctx.status = 401; + ctx.body = { + ok: false, + status: 'unauthorized', + message: '内部接口需要管理员令牌(Authorization: Bearer 或 X-Internal-Token)', + }; + return; + } + if (!(cfg.adminIds || []).includes(userId)) { + ctx.status = 403; + ctx.body = { ok: false, status: 'forbidden', message: '当前账号没有内部管理权限' }; + return; + } + + const user = await ctx.service.user.findById(userId); + if (!user) { + ctx.status = 401; + ctx.body = { ok: false, status: 'unauthorized', message: '令牌对应的用户不存在' }; + return; + } + if (Number(user.status) !== 1) { + ctx.status = 403; + ctx.body = { ok: false, status: 'forbidden', message: '账号已被禁用' }; + return; + } + + ctx.state.internal = { via: 'user', user }; + ctx.locals = ctx.locals || {}; + ctx.locals.user = user; + await next(); + }; +}; + +/** 取 header 里的用户令牌:优先 Authorization: Bearer,其次 X-Access-Token */ +function bearerToken(ctx) { + const matched = /^Bearer\s+(.+)$/i.exec(ctx.get('authorization') || ''); + if (matched) return matched[1].trim(); + return String(ctx.get('x-access-token') || '').trim(); +} diff --git a/backend/app/middleware/scanner_auth.js b/backend/app/middleware/scanner_auth.js new file mode 100644 index 0000000..16be21b --- /dev/null +++ b/backend/app/middleware/scanner_auth.js @@ -0,0 +1,32 @@ +'use strict'; + +/** + * 扫描器身份校验(长期 JWT) + * + * 令牌来源(按优先级):`Authorization: Bearer ` → `X-Scanner-Token` → `?access_token=`。 + * + * 校验链路(实现在 `service/scanner.js#resolveByToken`,测试页模拟上报也用同一个方法): + * 1. 验签 + 过期检查(app/service/jwt.js); + * 2. 回查数据库确认扫描器存在且未被禁用(status=1); + * 3. 比对库里保存的 jti 与令牌里的 jti —— 重新注册/登录会换 jti,旧令牌立即失效。 + * + * 通过后:`ctx.state.scanner` 与 `ctx.locals.scanner` 都指向该扫描器。 + */ +module.exports = () => { + return async function scannerAuth(ctx, next) { + const scanner = await ctx.service.scanner.resolveByToken(extractToken(ctx)); + + ctx.state.scanner = scanner; + ctx.locals = ctx.locals || {}; + ctx.locals.scanner = scanner; + await next(); + }; +}; + +function extractToken(ctx) { + const header = ctx.get('authorization'); + if (header && /^Bearer\s+/i.test(header)) { + return header.replace(/^Bearer\s+/i, '').trim(); + } + return ctx.get('x-scanner-token') || ctx.query.access_token || null; +} diff --git a/backend/app/model/scan_channel.js b/backend/app/model/scan_channel.js new file mode 100644 index 0000000..9962c4f --- /dev/null +++ b/backend/app/model/scan_channel.js @@ -0,0 +1,34 @@ +'use strict'; + +/** + * 扫描中控通道表模型(scan_channels) + * + * 一台「中控(绑定端)」可以接多个扫码设备,每个扫码设备对应一个通道; + * 中控通过 POST /api/scan/channels 把通道(channel_id + channel_name)上报到服务, + * 一个通道一行,唯一键 (scanner_id, channel_id):中控再次上报同名通道就是更新。 + * + * 注意:channel_id 只在同一中控内唯一,所以关联时要用 (scanner_id, channel_id) 两个字段。 + */ +module.exports = (app) => { + const { BIGINT, STRING, TINYINT, DATE } = app.Sequelize; + + const ScanChannel = app.model.define('scanChannel', { + id: { type: BIGINT.UNSIGNED, primaryKey: true, autoIncrement: true, comment: '主键' }, + scannerId: { type: BIGINT.UNSIGNED, allowNull: false, comment: '上报的中控(= scanners.id)' }, + channelId: { type: STRING(64), allowNull: false, comment: '通道 id(中控上报,同一中控内唯一)' }, + channelName: { type: STRING(128), allowNull: false, defaultValue: '', comment: '通道名(中控上报)' }, + lastReportAt: { type: DATE, comment: '最近一次上报时间' }, + status: { type: TINYINT.UNSIGNED, allowNull: false, defaultValue: 1, comment: '状态:1正常 0停用' }, + remark: { type: STRING(255), comment: '备注' }, + }, { + tableName: 'scan_channels', + paranoid: true, + comment: '扫描中控通道表', + }); + + ScanChannel.associate = function() { + app.model.ScanChannel.belongsTo(app.model.Scanner, { foreignKey: 'scanner_id', as: 'scanner' }); + }; + + return ScanChannel; +}; diff --git a/backend/app/model/scan_record.js b/backend/app/model/scan_record.js new file mode 100644 index 0000000..1bfb359 --- /dev/null +++ b/backend/app/model/scan_record.js @@ -0,0 +1,34 @@ +'use strict'; + +/** + * 扫码记录表模型(scan_records) + * + * 中控通过 POST /api/scan/records 上报扫码流水:条码 + 扫描时间 + 通道 id。 + * 去重靠唯一键 (scanner_id, channel_id, barcode, scan_time):完全相同的上报只入库一次。 + * + * 本表是流水表,**不用软删除**(paranoid 关闭): + * 软删除会让记录占用唯一键,导致同一条扫码数据再也无法入库; + * 需要清理请按时间物理删除。 + */ +module.exports = (app) => { + const { BIGINT, STRING, DATE } = app.Sequelize; + + const ScanRecord = app.model.define('scanRecord', { + id: { type: BIGINT.UNSIGNED, primaryKey: true, autoIncrement: true, comment: '主键' }, + scannerId: { type: BIGINT.UNSIGNED, allowNull: false, comment: '上报的中控(= scanners.id)' }, + channelId: { type: STRING(64), allowNull: false, comment: '通道 id' }, + barcode: { type: STRING(255), allowNull: false, comment: '条码内容' }, + scanTime: { type: DATE, allowNull: false, comment: '扫描时间(中控上报,秒级)' }, + reportedAt: { type: DATE, allowNull: false, defaultValue: app.Sequelize.NOW, comment: '服务端接收时间' }, + }, { + tableName: 'scan_records', + paranoid: false, + comment: '扫码记录表(去重)', + }); + + ScanRecord.associate = function() { + app.model.ScanRecord.belongsTo(app.model.Scanner, { foreignKey: 'scanner_id', as: 'scanner' }); + }; + + return ScanRecord; +}; diff --git a/backend/app/model/scanner.js b/backend/app/model/scanner.js new file mode 100644 index 0000000..9f2b7b1 --- /dev/null +++ b/backend/app/model/scanner.js @@ -0,0 +1,42 @@ +'use strict'; + +/** + * 扫描器(设备)表模型(scanners) + * + * 设备身份只有一种:`GET /api/device/login` 扫码登录换来的长期 JWT + * (建记录/绑定都发生在「手机确认登录」那一刻),库里只存当前令牌的 `jti`(重签即失效)。 + * `user_id` 为空表示尚未绑定账号。 + */ +module.exports = (app) => { + const { BIGINT, STRING, TINYINT, DATE } = app.Sequelize; + + const Scanner = app.model.define('scanner', { + id: { type: BIGINT.UNSIGNED, primaryKey: true, autoIncrement: true, comment: '主键' }, + userId: { type: BIGINT.UNSIGNED, comment: '绑定的用户 id' }, + sn: { type: STRING(64), allowNull: false, comment: '扫描器 SN(唯一标识)' }, + name: { type: STRING(64), allowNull: false, defaultValue: '', comment: '名称 / 别名' }, + vendor: { type: STRING(64), comment: '厂商' }, + model: { type: STRING(64), comment: '型号' }, + firmware: { type: STRING(32), comment: '固件 / 客户端版本' }, + ip: { type: STRING(45), comment: '最近登录 IP' }, + // ⚠️ 历史字段:早期「sn + secret 注册/登录」用的密钥哈希,现在已不再写入/校验(列保留) + secretHash: { type: STRING(100), comment: '历史字段:扫描器密钥哈希(已废弃)' }, + // 库里不存 JWT 本体,只存当前令牌的 jti:重签令牌会让旧令牌立即失效 + tokenJti: { type: STRING(64), comment: '当前 JWT 的 jti' }, + tokenExpiresAt: { type: DATE, comment: '令牌过期时间' }, + status: { type: TINYINT.UNSIGNED, allowNull: false, defaultValue: 1, comment: '状态:1正常 0禁用' }, + lastRegisterAt: { type: DATE, comment: '最近注册时间' }, + lastLoginAt: { type: DATE, comment: '最近登录时间' }, + lastSeenAt: { type: DATE, comment: '最近心跳时间' }, + }, { + tableName: 'scanners', + paranoid: true, + comment: '扫描器表', + }); + + Scanner.associate = function() { + app.model.Scanner.belongsTo(app.model.User, { foreignKey: 'user_id', as: 'user' }); + }; + + return Scanner; +}; diff --git a/backend/app/model/sys_config.js b/backend/app/model/sys_config.js new file mode 100644 index 0000000..96d8e69 --- /dev/null +++ b/backend/app/model/sys_config.js @@ -0,0 +1,30 @@ +'use strict'; + +/** + * 系统配置表模型(sys_config) + * + * 通用 key-value 配置:group_name + config_key 唯一定位一条配置, + * value_type 决定 config_value 的解析方式(string / number / boolean / json)。 + * + * 注意:唯一性由 service 层保证(先查后写),不建唯一索引 —— + * 因为本表用 deleted_at 软删除,唯一索引会被已删除的记录占用,导致同 key 无法重建。 + */ +module.exports = (app) => { + const { BIGINT, STRING, TEXT, TINYINT } = app.Sequelize; + + const SysConfig = app.model.define('sysConfig', { + id: { type: BIGINT.UNSIGNED, primaryKey: true, autoIncrement: true, comment: '主键' }, + groupName: { type: STRING(64), allowNull: false, defaultValue: 'default', comment: '分组' }, + configKey: { type: STRING(128), allowNull: false, comment: '配置键' }, + configValue: { type: TEXT, comment: '配置值' }, + valueType: { type: STRING(16), allowNull: false, defaultValue: 'string', comment: 'string/number/boolean/json' }, + remark: { type: STRING(255), comment: '备注' }, + status: { type: TINYINT.UNSIGNED, allowNull: false, defaultValue: 1, comment: '状态:1启用 0禁用' }, + }, { + tableName: 'sys_config', + paranoid: true, + comment: '系统配置表', + }); + + return SysConfig; +}; diff --git a/backend/app/model/user.js b/backend/app/model/user.js new file mode 100644 index 0000000..ecee7e6 --- /dev/null +++ b/backend/app/model/user.js @@ -0,0 +1,38 @@ +'use strict'; + +/** + * 用户表模型(users) + * + * 通用约定在 config/config.default.js 的 sequelize.define 里配置: + * freezeTableName / underscored / created_at / updated_at, + * 这里通过 paranoid: true 开启软删除(对应 deleted_at 字段)。 + */ +module.exports = (app) => { + const { BIGINT, STRING, TINYINT, DATE } = app.Sequelize; + + const User = app.model.define('user', { + id: { type: BIGINT.UNSIGNED, primaryKey: true, autoIncrement: true, comment: '主键' }, + username: { type: STRING(64), comment: '登录名' }, + nickname: { type: STRING(64), allowNull: false, defaultValue: '', comment: '昵称' }, + email: { type: STRING(128), comment: '邮箱(可选,可作登录账号)' }, + avatar: { type: STRING(255), allowNull: false, defaultValue: '', comment: '头像地址' }, + phone: { type: STRING(20), comment: '手机号' }, + // 密码哈希(bcrypt),接口与模板都不外泄:查询时会显式 exclude + passwordHash: { type: STRING(100), comment: '密码哈希(bcrypt)' }, + gender: { type: TINYINT.UNSIGNED, allowNull: false, defaultValue: 0, comment: '性别:0未知 1男 2女' }, + status: { type: TINYINT.UNSIGNED, allowNull: false, defaultValue: 1, comment: '状态:1正常 0禁用' }, + remark: { type: STRING(255), comment: '备注' }, + lastLoginAt: { type: DATE, comment: '最近登录时间' }, + }, { + tableName: 'users', + paranoid: true, + comment: '用户表', + }); + + User.associate = function() { + app.model.User.hasMany(app.model.WechatOauth, { foreignKey: 'user_id', as: 'wechats' }); + app.model.User.hasMany(app.model.Scanner, { foreignKey: 'user_id', as: 'scanners' }); + }; + + return User; +}; diff --git a/backend/app/model/wechat_oauth.js b/backend/app/model/wechat_oauth.js new file mode 100644 index 0000000..87e3efc --- /dev/null +++ b/backend/app/model/wechat_oauth.js @@ -0,0 +1,40 @@ +'use strict'; + +/** + * 微信授权表模型(wechat_oauth) + * + * 一条记录 = 某个用户在某个 appid 下的一次微信授权, + * 因此一个用户可绑定多个微信(公众号 / 小程序 / 开放平台)。 + * 关联:WechatOauth.belongsTo(User, { as: 'user' }), + * 可通过 { include: [{ model: app.model.User, as: 'user' }] } 取出对应用户。 + */ +module.exports = (app) => { + const { BIGINT, STRING, DATE } = app.Sequelize; + + const WechatOauth = app.model.define('wechatOauth', { + id: { type: BIGINT.UNSIGNED, primaryKey: true, autoIncrement: true, comment: '主键' }, + // 下划线映射由 config.sequelize.define.underscored 统一处理(userId -> user_id) + userId: { type: BIGINT.UNSIGNED, allowNull: false, comment: '关联 users.id' }, + appid: { type: STRING(64), allowNull: false, comment: '微信 appid' }, + openid: { type: STRING(64), allowNull: false, comment: '用户在该 appid 下的 openid' }, + unionid: { type: STRING(64), comment: '开放平台 unionid' }, + nickname: { type: STRING(64), allowNull: false, defaultValue: '', comment: '授权时微信昵称' }, + avatar: { type: STRING(255), allowNull: false, defaultValue: '', comment: '授权时微信头像' }, + sessionKey: { type: STRING(128), comment: '小程序 session_key' }, + accessToken: { type: STRING(512), comment: '网页授权 access_token' }, + refreshToken: { type: STRING(512), comment: '刷新令牌' }, + scope: { type: STRING(64), comment: '授权 scope' }, + tokenExpiresAt: { type: DATE, comment: 'access_token 过期时间' }, + lastAuthAt: { type: DATE, comment: '最近授权时间' }, + }, { + tableName: 'wechat_oauth', + paranoid: true, + comment: '微信授权表', + }); + + WechatOauth.associate = function() { + app.model.WechatOauth.belongsTo(app.model.User, { foreignKey: 'user_id', as: 'user' }); + }; + + return WechatOauth; +}; diff --git a/backend/app/router.js b/backend/app/router.js new file mode 100644 index 0000000..6f6d374 --- /dev/null +++ b/backend/app/router.js @@ -0,0 +1,105 @@ +'use strict'; + +/** + * 路由定义 + * @param {Egg.Application} app - egg application + */ +module.exports = (app) => { + const { router, controller, middleware } = app; + const apiAuth = middleware.apiAuth(); + const internalAuth = middleware.internalAuth(); + const scannerAuth = middleware.scannerAuth(); + + // ==================== JSON 接口 ==================== + // 控制器按「谁在调」分模块(app/controller/<模块>/): + // web/ 前端 SPA(用户端,toC:用户自己管自己的设备/记录)—— header 令牌(user JWT) + // device/ 设备(长期 JWT,typ=scanner) + // auth/ 公开的登录码接口(发码/查码/确认) + // internal/ 运维/内部(用户与配置的 CRUD)—— 需内部令牌 + // home / health 放在根(公共) + // + // ⚠️ 后端**不再渲染任何页面**:`/` 这一侧由 app/middleware/frontend.js 处理 + // (开发时反代到前端 dev server,生产时托管 frontend/dist)。 + router.get('/api/info', controller.home.index); + router.get('/health', controller.health.index); + + // ---------- web 用户端(前端 SPA 调;登录/注册等公开,其余要令牌) ---------- + router.post('/api/web/auth/login', controller.web.auth.login); + router.post('/api/web/auth/register/code', controller.web.auth.sendRegisterCode); + router.post('/api/web/auth/register', controller.web.auth.register); + router.post('/api/web/auth/forgot', controller.web.auth.forgot); + router.post('/api/web/auth/reset', controller.web.auth.reset); + + router.get('/api/web/me', apiAuth, controller.web.profile.show); + router.put('/api/web/me', apiAuth, controller.web.profile.update); + router.put('/api/web/me/password', apiAuth, controller.web.profile.changePassword); + + // 首页统计(只统计当前用户名下的数据) + router.get('/api/web/stats', apiAuth, controller.web.stats.index); + + // 我的设备:列表 / 详情 / 通道 / 解绑 / 删除(越权访问一律 404) + router.get('/api/web/devices', apiAuth, controller.web.device.index); + router.get('/api/web/devices/:id', apiAuth, controller.web.device.show); + router.get('/api/web/devices/:id/channels', apiAuth, controller.web.device.channels); + router.post('/api/web/devices/:id/unbind', apiAuth, controller.web.device.unbind); + router.delete('/api/web/devices/:id', apiAuth, controller.web.device.destroy); + + // 我的扫码记录(范围限定在当前用户名下的设备) + router.get('/api/web/records', apiAuth, controller.web.record.index); + + // 前端「测试页」的模拟接口(模拟设备扫码登录 / 模拟中控上报),与真机走同一套 service + router.post('/api/web/test/device-login', apiAuth, controller.web.test.deviceLogin); + router.post('/api/web/test/scan', apiAuth, controller.web.test.scan); + + // ---------- 运维/内部(脚本、后台系统;**需内部令牌**,见 middleware/internal_auth.js)---------- + router.get('/api/users', internalAuth, controller.internal.user.index); + router.get('/api/users/:id', internalAuth, controller.internal.user.show); + router.post('/api/users', internalAuth, controller.internal.user.create); + router.put('/api/users/:id', internalAuth, controller.internal.user.update); + router.delete('/api/users/:id', internalAuth, controller.internal.user.destroy); + + // 微信授权(绑定关系) + router.get('/api/users/:id/wechats', internalAuth, controller.internal.wechat.indexByUser); + router.get('/api/wechat/:appid/:openid', internalAuth, controller.internal.wechat.show); + router.post('/api/wechat/bind', internalAuth, controller.internal.wechat.bind); + router.put('/api/wechat/:id/tokens', internalAuth, controller.internal.wechat.updateTokens); + router.delete('/api/wechat/:id', internalAuth, controller.internal.wechat.unbind); + + // 系统配置(读接口带 Redis 缓存,写接口自动失效) + router.get('/api/configs', internalAuth, controller.internal.config.index); + router.put('/api/configs', internalAuth, controller.internal.config.upsert); + router.get('/api/configs/:group', internalAuth, controller.internal.config.showGroup); + router.get('/api/configs/:group/:key', internalAuth, controller.internal.config.show); + router.delete('/api/configs/:group/:key', internalAuth, controller.internal.config.destroy); + + // 设备管理(运维视角:可看/可管所有人的设备):绑定 / 解绑 / 列表 / 删除 + router.post('/api/scanner/bind', internalAuth, controller.internal.device.bind); + router.post('/api/scanner/unbind', internalAuth, controller.internal.device.unbind); + router.get('/api/scanners', internalAuth, controller.internal.device.index); + router.get('/api/scanners/:id', internalAuth, controller.internal.device.show); + router.delete('/api/scanners/:id', internalAuth, controller.internal.device.destroy); + + // ---------- 公开的登录接口(auth)---------- + // 登录码二维码(SVG,本地生成;前端登录页直接 img 引用) + router.get('/api/wechat/qrcode.svg', controller.auth.wechat.qrcode); + // 扫码登录(前端/客户端接口):不带参数发串码,带 ?code=&wait= 长轮询并拿用户 JWT + router.get('/api/wechat/login', controller.auth.wechat.login); + // 查登录码状态(无需登录) + router.get('/api/wechat/status', controller.auth.wechat.status); + // 微信公众号网页授权回调(微信把手机浏览器重定向到这里,处理完再转回前端 /wechat 页) + router.get('/api/wechat/callback', controller.auth.wechat.callback); + // 设备发码 + 长轮询:**这一步才注册/绑定**并直接拿到长期 JWT(发码不需要任何凭据) + router.get('/api/device/login', controller.device.auth.login); + + // ---------- 用户态(client):小程序 / Win 客户端 / SPA ---------- + // 用登录码触发登录(**不认 cookie**:header 带 Authorization: Bearer 就行) + router.post('/api/wechat/confirm', apiAuth, controller.client.wechat.confirm); + + // ---------- 设备态(device):需长期 JWT ---------- + router.get('/api/scanner/me', scannerAuth, controller.device.self.me); + router.post('/api/scanner/heartbeat', scannerAuth, controller.device.self.heartbeat); + router.post('/api/scan/channels', scannerAuth, controller.device.scan.reportChannels); + router.get('/api/scan/channels', scannerAuth, controller.device.scan.channels); + router.post('/api/scan/records', scannerAuth, controller.device.scan.reportRecords); + router.get('/api/scan/records', scannerAuth, controller.device.scan.records); +}; diff --git a/backend/app/service/auth.js b/backend/app/service/auth.js new file mode 100644 index 0000000..d273cb0 --- /dev/null +++ b/backend/app/service/auth.js @@ -0,0 +1,90 @@ +'use strict'; + +const { Service } = require('egg'); +const bcrypt = require('bcryptjs'); + +/** bcrypt 成本因子,改这里等于改全站强度(与 scripts/set-password.js 保持一致) */ +const BCRYPT_ROUNDS = 10; + +/** 账号不存在时也做一次比较,避免通过响应时间探测账号是否存在 */ +const DUMMY_HASH = bcrypt.hashSync('pack-service-dummy-password', BCRYPT_ROUNDS); + +class AuthService extends Service { + /** 生成密码哈希(存库用) */ + async hashPassword(plain) { + return bcrypt.hash(String(plain), BCRYPT_ROUNDS); + } + + /** + * 账号密码登录:account 支持用户名或手机号 + * @param {string} account 用户名 / 手机号 + * @param {string} password 明文密码 + * @return {Promise} 成功返回脱敏用户信息,失败返回 null + */ + async login(account, password) { + if (!account || !password) return null; + + const user = await this.ctx.service.user.findByAccount(account); + const hash = user && user.passwordHash ? user.passwordHash : DUMMY_HASH; + const matched = await bcrypt.compare(String(password), hash); + + if (!user || !matched) { + this.ctx.logger.warn('[auth] 登录失败: %s', account); + return null; + } + if (Number(user.status) !== 1) { + this.ctx.logger.warn('[auth] 账号已被禁用: %s', account); + return null; + } + + await user.update({ lastLoginAt: new Date() }); + return this.ctx.service.user.toSafeUser(user); + } + + /** + * 自助注册:建用户 + 写入密码哈希 + * 用户名/手机号唯一性由 user service 的 assertUnique 保证(冲突抛 409) + * @return {Promise} 脱敏用户信息(不含密码哈希) + */ + async register({ username, password, nickname, phone, email }) { + const user = await this.ctx.service.user.create({ + username, + nickname: nickname || username, + phone: phone || null, + email: email || null, + }); + await this.ctx.service.user.setPassword(user.id, await this.hashPassword(password)); + this.ctx.logger.info('[auth] 新用户注册: %s (id=%s)', username, user.id); + return user; + } + + /** + * 设置/重置密码(脚本或后续的改密接口用) + * @return {Promise} 用户不存在返回 false + */ + async setPassword(userId, plain) { + const hash = await this.hashPassword(plain); + return this.ctx.service.user.setPassword(userId, hash); + } + + /** + * 修改密码:先校验原密码,再写入新哈希 + * @return {Promise} 原密码不对或用户不存在返回 false + */ + async changePassword(userId, oldPassword, newPassword) { + const user = await this.ctx.service.user.findByIdWithPassword(userId); + if (!user || !user.passwordHash) return false; + + const matched = await bcrypt.compare(String(oldPassword), user.passwordHash); + if (!matched) { + this.ctx.logger.warn('[auth] 修改密码失败:原密码不正确, userId=%s', userId); + return false; + } + + await user.update({ passwordHash: await this.hashPassword(newPassword) }); + this.ctx.logger.info('[auth] 密码已修改, userId=%s', userId); + return true; + } +} + +module.exports = AuthService; diff --git a/backend/app/service/cache.js b/backend/app/service/cache.js new file mode 100644 index 0000000..1ffce8e --- /dev/null +++ b/backend/app/service/cache.js @@ -0,0 +1,87 @@ +'use strict'; + +const { Service } = require('egg'); + +class CacheService extends Service { + get redis() { + return this.app.redis; + } + + get prefix() { + return this.config.cache.prefix; + } + + /** 统一拼 key,避免不同业务互相覆盖 */ + key(name) { + return this.prefix ? `${this.prefix}${name}` : name; + } + + /** + * Redis 不可用时降级(返回 fallback),不阻塞主流程: + * 缓存只是旁路,读不到就回源,写不进去也只是少一次缓存 + */ + async _call(action, fallback) { + if (!this.app.redis) return fallback; + try { + return await action(); + } catch (err) { + this.ctx.logger.warn('[cache] redis 异常,已降级: %s', err.message); + return fallback; + } + } + + /** 读取并自动 JSON 反序列化,未命中返回 null */ + async get(name) { + const raw = await this._call(() => this.redis.get(this.key(name)), null); + if (raw === null || raw === undefined) return null; + try { + return JSON.parse(raw); + } catch (err) { + // 不是 JSON 就按字符串返回 + return raw; + } + } + + /** 写入,ttl 单位秒;ttl <= 0 表示永不过期 */ + async set(name, value, ttl = this.config.cache.ttl) { + const raw = typeof value === 'string' ? value : JSON.stringify(value); + const key = this.key(name); + if (ttl > 0) return this._call(() => this.redis.setex(key, ttl, raw), 'OK'); + return this._call(() => this.redis.set(key, raw), 'OK'); + } + + async del(name) { + return this._call(() => this.redis.del(this.key(name)), 0); + } + + async ttl(name) { + return this._call(() => this.redis.ttl(this.key(name)), -2); + } + + /** 计数器,可用于限流、统计等场景(Redis 不可用时抛出,不做降级) */ + async incr(name, ttl) { + const key = this.key(name); + const value = await this.redis.incr(key); + if (ttl > 0 && value === 1) { + await this.redis.expire(key, ttl); + } + return value; + } + + /** + * 缓存旁路(cache-aside):命中直接返回,未命中回源并写入缓存 + * loader 返回 null/undefined 时不写缓存 + */ + async remember(name, ttl, loader) { + const cached = await this.get(name); + if (cached !== null) return cached; + + const value = await loader(); + if (value === null || value === undefined) return value; + + await this.set(name, value, ttl); + return value; + } +} + +module.exports = CacheService; diff --git a/backend/app/service/config.js b/backend/app/service/config.js new file mode 100644 index 0000000..17939f8 --- /dev/null +++ b/backend/app/service/config.js @@ -0,0 +1,131 @@ +'use strict'; + +const { Service } = require('egg'); + +/** 根据 value_type 把数据库里的字符串还原成对应类型 */ +function parseValue(configValue, valueType) { + if (configValue === null || configValue === undefined) return null; + switch (valueType) { + case 'number': + return Number(configValue); + case 'boolean': + return configValue === 'true' || configValue === '1'; + case 'json': + try { + return JSON.parse(configValue); + } catch (err) { + this.ctx.logger.warn('[config] %s 不是合法 JSON,按字符串返回', configValue); + return configValue; + } + default: + return configValue; + } +} + +/** 写入前把值统一序列化成字符串 */ +function stringifyValue(configValue, valueType) { + if (configValue === null || configValue === undefined) return null; + if (valueType === 'json') { + return typeof configValue === 'string' ? configValue : JSON.stringify(configValue); + } + if (typeof configValue === 'object') return JSON.stringify(configValue); + return String(configValue); +} + +class ConfigService extends Service { + get SysConfig() { + return this.app.model.SysConfig; + } + + /** 缓存 key:配置读多写少,走 Redis 缓存,写入/删除时清除 */ + cacheKey(groupName, configKey) { + return `config:${groupName}:${configKey}`; + } + + /** 按 group + key 查询记录(不过滤 status,内部用) */ + async findOne(groupName, configKey) { + return this.SysConfig.findOne({ where: { groupName, configKey } }); + } + + /** + * 读取单个配置值,带 Redis 缓存;不存在或已禁用时返回 defaultValue + */ + async get(groupName, configKey, defaultValue = null) { + const row = await this.ctx.service.cache.remember( + this.cacheKey(groupName, configKey), + this.config.cache.ttl, + async () => { + const found = await this.SysConfig.findOne({ where: { groupName, configKey, status: 1 } }); + return found ? found.toJSON() : null; + }, + ); + + if (!row) return defaultValue; + return parseValue.call(this, row.configValue, row.valueType); + } + + /** 读取一个分组下所有启用的配置,返回 { key: value } */ + async getGroup(groupName) { + const rows = await this.SysConfig.findAll({ + where: { groupName, status: 1 }, + order: [[ 'configKey', 'ASC' ]], + }); + + const result = {}; + for (const row of rows) { + result[row.configKey] = parseValue.call(this, row.configValue, row.valueType); + } + return result; + } + + /** 列表(管理用,含禁用项) */ + async list({ groupName } = {}) { + const where = {}; + if (groupName) where.groupName = groupName; + + const rows = await this.SysConfig.findAll({ + where, + order: [[ 'groupName', 'ASC' ], [ 'configKey', 'ASC' ]], + }); + return rows.map(row => row.toJSON()); + } + + /** 新增或更新(幂等 upsert),返回写入后的记录 */ + async set({ groupName = 'default', configKey, configValue, valueType = 'string', remark, status = 1 }) { + if (!configKey) { + this.ctx.throw(422, 'configKey 不能为空'); + } + + const value = stringifyValue(configValue, valueType); + const existing = await this.findOne(groupName, configKey); + + let record; + if (existing) { + await existing.update({ configValue: value, valueType, remark, status }); + record = existing; + } else { + record = await this.SysConfig.create({ groupName, configKey, configValue: value, valueType, remark, status }); + } + + await this.clearCache(groupName, configKey); + return record.toJSON(); + } + + /** 软删除配置,返回是否删除成功 */ + async remove(groupName, configKey) { + const affected = await this.SysConfig.destroy({ where: { groupName, configKey } }); + await this.clearCache(groupName, configKey); + return affected > 0; + } + + async clearCache(groupName, configKey) { + await this.ctx.service.cache.del(this.cacheKey(groupName, configKey)); + } + + /** 总数(首页统计用) */ + async count(where = {}) { + return this.SysConfig.count({ where }); + } +} + +module.exports = ConfigService; diff --git a/backend/app/service/health.js b/backend/app/service/health.js new file mode 100644 index 0000000..0e4aa0c --- /dev/null +++ b/backend/app/service/health.js @@ -0,0 +1,31 @@ +'use strict'; + +const { Service } = require('egg'); + +class HealthService extends Service { + /** MySQL 连通性探测(authenticate 会真正建立一次连接) */ + async checkMysql() { + const start = Date.now(); + try { + await this.app.model.authenticate(); + return { ok: true, cost: Date.now() - start }; + } catch (err) { + this.ctx.logger.warn('[health] mysql 不可用: %s', err.message); + return { ok: false, cost: Date.now() - start, error: err.message }; + } + } + + /** Redis 连通性探测 */ + async checkRedis() { + const start = Date.now(); + try { + const pong = await this.app.redis.ping(); + return { ok: pong === 'PONG', cost: Date.now() - start }; + } catch (err) { + this.ctx.logger.warn('[health] redis 不可用: %s', err.message); + return { ok: false, cost: Date.now() - start, error: err.message }; + } + } +} + +module.exports = HealthService; diff --git a/backend/app/service/jwt.js b/backend/app/service/jwt.js new file mode 100644 index 0000000..d659639 --- /dev/null +++ b/backend/app/service/jwt.js @@ -0,0 +1,135 @@ +'use strict'; + +const { Service } = require('egg'); +const jwt = require('jsonwebtoken'); + +/** 时长单位换算(秒):用于把 '30d' 这类写法解析成秒数,做上限校验 */ +const DURATION_UNITS = { s: 1, m: 60, h: 3600, d: 86400, w: 604800, y: 31536000 }; + +/** + * JWT 服务:签发 / 校验令牌 + * + * - **扫描器长期令牌**(typ=scanner,默认 1 年,见 config.jwt.scannerExpiresIn), + * 撤销靠库里存当前 jti + 扫描器 status 比对(见 app/middleware/scanner_auth.js): + * 重新注册/登录会换新 jti,旧令牌立即失效;status=0 或删除扫描器,令牌立即失效。 + * - **用户令牌**(typ=user,默认 7 天,见 config.jwt.userExpiresIn):给前端(SPA / 小程序 / 扫码登录) + * 用,接口带 `Authorization: Bearer ` 即可,见 app/middleware/auth.js。 + */ +class JwtService extends Service { + get secret() { + return this.config.jwt.secret; + } + + /** + * 时长解析:`'30d'` / `'12h'` / `'90m'` / `'30s'` / `'2w'` / `'1y'` 或纯数字(秒) + * @param {string|number} value 时长 + * @return {number} 秒数;解析不了返回 0 + */ + parseDuration(value) { + if (value === undefined || value === null || value === '') return 0; + const text = String(value).trim(); + if (/^\d+$/.test(text)) return Number(text); + + const matched = /^(\d+)\s*([smhdwy])$/.exec(text.toLowerCase()); + if (!matched) return 0; + return Number(matched[1]) * (DURATION_UNITS[matched[2]] || 0); + } + + /** + * 签发用户令牌 + * @param {object} user 至少含 id(可带 username) + * @return {string} JWT + */ + signUser(user) { + const payload = { + sub: String(user.id), + username: user.username || null, + typ: 'user', + }; + + return jwt.sign(payload, this.secret, { + algorithm: 'HS256', + expiresIn: this.config.jwt.userExpiresIn, + issuer: this.config.jwt.issuer, + audience: this.config.jwt.audience, + }); + } + + /** + * 校验用户令牌,失败返回 null(不抛错,调用方自己决定怎么响应) + * @return {object|null} payload(含 sub / typ / exp) + */ + verifyUser(token) { + try { + const payload = jwt.verify(token, this.secret, { + algorithms: [ 'HS256' ], + issuer: this.config.jwt.issuer, + audience: this.config.jwt.audience, + }); + return payload && payload.typ === 'user' ? payload : null; + } catch (err) { + this.ctx.logger.warn('[jwt] 用户令牌校验失败(%s): %s', err.name, err.message); + return null; + } + } + /** + * 签发扫描器长期令牌 + * @param {object} scanner 至少含 id、sn + * @param {object} extra 额外声明(如 jti) + * @param {object} options { expiresIn 覆盖有效期(秒数或 '30d' 这种写法,不传用 config.jwt.scannerExpiresIn) } + * @return {string} JWT + */ + signScanner(scanner, extra = {}, options = {}) { + const payload = Object.assign({ + sub: String(scanner.id), + sn: scanner.sn, + typ: 'scanner', + }, extra); + + return jwt.sign(payload, this.secret, { + algorithm: 'HS256', + expiresIn: options.expiresIn || this.config.jwt.scannerExpiresIn, + issuer: this.config.jwt.issuer, + audience: this.config.jwt.audience, + }); + } + + /** + * 校验扫描器令牌,失败直接抛 401 + * + * ⚠️ 必须检查 `typ`:用户令牌与设备令牌用的是同一把密钥、同一对 issuer/audience, + * 不比对 `typ` 的话**用户令牌就能当设备令牌用**(用户 id 与设备 id 撞上号就出事)。 + * @return {object} payload(含 sub / sn / jti / exp) + */ + verifyScanner(token) { + let payload; + try { + payload = jwt.verify(token, this.secret, { + algorithms: [ 'HS256' ], + issuer: this.config.jwt.issuer, + audience: this.config.jwt.audience, + }); + } catch (err) { + const message = err.name === 'TokenExpiredError' + ? '扫描器令牌已过期,请重新注册/登录' + : '扫描器令牌无效'; + this.ctx.logger.warn('[jwt] 校验失败(%s): %s', err.name, err.message); + this.ctx.throw(401, message); + return null; + } + + if (!payload || payload.typ !== 'scanner') { + this.ctx.logger.warn('[jwt] 拿到的不是设备令牌: typ=%s', payload && payload.typ); + this.ctx.throw(401, '不是设备令牌(设备接口只认 typ=scanner 的长期 JWT)'); + } + return payload; + } + + /** 取令牌的过期时间(存库/展示用) */ + expiresAtOf(token) { + const decoded = jwt.decode(token); + return decoded && decoded.exp ? new Date(decoded.exp * 1000) : null; + } +} + +module.exports = JwtService; diff --git a/backend/app/service/mail.js b/backend/app/service/mail.js new file mode 100644 index 0000000..1977c89 --- /dev/null +++ b/backend/app/service/mail.js @@ -0,0 +1,89 @@ +'use strict'; + +const { Service } = require('egg'); + +/** + * 邮件发送(注册验证码 / 重置密码链接) + * + * 两种模式: + * - **开发模式**(`config.email.devMode`,即没配 SMTP_HOST 时):不发真邮件, + * 把验证码/重置链接写进服务端日志,并在返回值里回传,让页面能提示出来(仅本地/测试用)。 + * - **SMTP 模式**:配好 SMTP_HOST / SMTP_PORT / SMTP_USER / SMTP_PASSWORD(+ SMTP_FROM)后自动启用, + * 用 nodemailer 真发信(依赖懒加载,开发模式不需要它)。 + */ +class MailService extends Service { + /** + * 发送验证码邮件 + * @param {string} email 收件邮箱 + * @param {string} code 6 位验证码 + * @param {object} options { ttl 有效期(秒) } + * @return {Promise<{devMode:boolean, code?:string, failed?:boolean, messageId?:string}>} + */ + async sendVerifyCode(email, code, { ttl } = {}) { + const cfg = this.app.config.email; + const site = this.app.config.siteName; + const minutes = Math.max(Math.round((ttl || cfg.codeTtl) / 60), 1); + const text = `你的 ${site} 注册验证码是 ${code},${minutes} 分钟内有效。\n` + + '如果不是你本人操作,忽略本邮件即可。'; + + if (cfg.devMode) { + this.ctx.logger.info('[mail][dev] 未配置 SMTP,验证码不发真邮件 → %s : %s', email, code); + return { devMode: true, code }; + } + + const res = await this.deliver({ to: email, subject: `${site} 注册验证码`, text }); + return Object.assign({ devMode: false }, res); + } + + /** + * 发送重置密码链接邮件 + * @param {string} email 收件邮箱 + * @param {string} url 重置地址(绝对地址,带 token) + * @param {object} options { ttl 链接有效期(秒) } + * @return {Promise<{devMode:boolean, url?:string, failed?:boolean, messageId?:string}>} + */ + async sendResetLink(email, url, { ttl } = {}) { + const cfg = this.app.config.email; + const site = this.app.config.siteName; + const minutes = Math.max(Math.round((ttl || cfg.resetTtl) / 60), 1); + const text = `我们收到了重置 ${site} 密码的请求,请打开下面的链接设置新密码(${minutes} 分钟内有效):\n` + + `${url}\n` + + '如果不是你本人操作,忽略本邮件即可,你的密码不会被修改。'; + + if (cfg.devMode) { + this.ctx.logger.info('[mail][dev] 未配置 SMTP,重置链接不发真邮件 → %s : %s', email, url); + return { devMode: true, url }; + } + + const res = await this.deliver({ to: email, subject: `${site} 重置密码`, text }); + return Object.assign({ devMode: false }, res); + } + + /** + * 真正发信(SMTP 模式) + * @param {object} mail { to, subject, text } + * @return {Promise<{messageId?:string, failed?:boolean, message?:string}>} + */ + async deliver({ to, subject, text }) { + const cfg = this.app.config.email; + try { + // 懒加载:开发模式(默认)下不依赖这个包 + const nodemailer = require('nodemailer'); + const transporter = nodemailer.createTransport({ + host: cfg.smtp.host, + port: cfg.smtp.port, + secure: cfg.smtp.secure, + auth: cfg.smtp.user ? { user: cfg.smtp.user, pass: cfg.smtp.password } : undefined, + }); + + const info = await transporter.sendMail({ from: cfg.from, to, subject, text }); + this.ctx.logger.info('[mail] 邮件已发送 %s (%s)', to, info.messageId || ''); + return { messageId: info.messageId }; + } catch (err) { + this.ctx.logger.error('[mail] 邮件发送失败 %s : %s', to, err.message); + return { failed: true, message: err.message }; + } + } +} + +module.exports = MailService; diff --git a/backend/app/service/password_reset.js b/backend/app/service/password_reset.js new file mode 100644 index 0000000..486736f --- /dev/null +++ b/backend/app/service/password_reset.js @@ -0,0 +1,126 @@ +'use strict'; + +const { Service } = require('egg'); +const crypto = require('crypto'); + +/** 重置令牌在 Redis 里的 key 段(与验证码分开,互不影响) */ +const SEGMENT = 'reset'; + +/** 令牌原文 → 摘要(Redis 里只存摘要,泄库也拿不到可用的重置链接) */ +function digest(token) { + return crypto.createHash('sha256').update(String(token)).digest('hex'); +} + +/** + * 邮箱找回密码:生成 / 校验 / 消费「重置密码链接」里的令牌 + * + * 存 Redis(都带 TTL,过期自动失效): + * - `packs:reset:token:<摘要>` 令牌 → 用户 id(TTL = config.email.resetTtl,默认 30 分钟) + * - `packs:reset:user:<用户id>` 该用户**当前**最后一次发出的令牌摘要(用于让旧链接立刻失效) + * - `packs:reset:sent:<用户id>` 重发节流标记(SET NX,TTL = config.email.resendInterval,默认 60 秒) + * + * 令牌是一次性的:重置成功后 `consume()` 把上面两个 key 都删掉。 + * 对外不抛异常,统一返回 `{ ok, message }`,方便页面回提示(不弹 500)。 + */ +class PasswordResetService extends Service { + get redis() { + return this.app.redis; + } + + get cfg() { + return this.app.config.email; + } + + prefix(rest) { + return `${this.app.config.cache.prefix}${SEGMENT}:${rest}`; + } + + tokenKey(token) { + return this.prefix(`token:${digest(token)}`); + } + + userKey(userId) { + return this.prefix(`user:${userId}`); + } + + sentKey(userId) { + return this.prefix(`sent:${userId}`); + } + + /** Redis 不可用时给友好提示,而不是让页面 500 */ + unavailable() { + return { ok: false, message: '重置密码服务暂不可用(Redis 未就绪),请稍后再试' }; + } + + /** + * 生成重置链接并发送邮件(同一个用户只保留最新一条链接,旧链接立即失效) + * @param {object} user 用户实例(需要 id / email) + * @param {string} origin 站点地址(如 http://127.0.0.1:7001) + * @return {Promise<{ok:boolean, message?:string, devMode?:boolean, url?:string}>} + */ + async send(user, origin) { + if (!this.redis) return this.unavailable(); + + const ttl = this.cfg.resetTtl; + let locked; + let token; + try { + // 重发节流:同一用户 resendInterval 秒内只发一次 + locked = await this.redis.set(this.sentKey(user.id), '1', 'EX', this.cfg.resendInterval, 'NX'); + if (locked !== 'OK') { + return { ok: false, message: `重置链接已发送,请 ${this.cfg.resendInterval} 秒后再试` }; + } + + // 先把旧链接作废,再写新链接 + const old = await this.redis.get(this.userKey(user.id)); + token = crypto.randomBytes(32).toString('hex'); + await this.redis.setex(this.tokenKey(token), ttl, String(user.id)); + await this.redis.setex(this.userKey(user.id), ttl, digest(token)); + if (old) await this.redis.del(this.prefix(`token:${old}`)); + } catch (err) { + this.ctx.logger.error('[reset] 生成重置令牌失败 user=%s : %s', user.id, err.message); + return this.unavailable(); + } + + const url = `${String(origin || '').replace(/\/+$/, '')}/reset?token=${token}`; + const mail = await this.ctx.service.mail.sendResetLink(user.email, url, { ttl }); + if (mail.failed) { + // 发信失败:把令牌撤掉并放开节流位,用户改完邮箱/稍后可立即重试 + await this.redis.del(this.tokenKey(token), this.userKey(user.id), this.sentKey(user.id)).catch(() => {}); + return { ok: false, message: '邮件发送失败,请稍后再试' }; + } + + this.ctx.logger.info('[reset] 重置链接已生成 user=%s email=%s', user.id, user.email); + return { ok: true, devMode: mail.devMode, url: mail.devMode ? url : undefined }; + } + + /** + * 校验令牌(不改动状态) + * @param {string} token 链接里的令牌原文 + * @return {Promise} 用户 id,无效/过期返回 null + */ + async verify(token) { + if (!this.redis || !token) return null; + try { + const userId = await this.redis.get(this.tokenKey(token)); + return userId ? Number(userId) : null; + } catch (err) { + this.ctx.logger.error('[reset] 校验令牌失败 : %s', err.message); + return null; + } + } + + /** 消费令牌(重置成功后调用,链接随即失效) */ + async consume(token, userId) { + if (!this.redis) return; + try { + await this.redis.del(this.tokenKey(token)); + await this.redis.del(this.userKey(userId)); + await this.redis.del(this.sentKey(userId)); + } catch (err) { + this.ctx.logger.warn('[reset] 清理令牌失败 : %s', err.message); + } + } +} + +module.exports = PasswordResetService; diff --git a/backend/app/service/scan.js b/backend/app/service/scan.js new file mode 100644 index 0000000..7860aee --- /dev/null +++ b/backend/app/service/scan.js @@ -0,0 +1,434 @@ +'use strict'; + +const { Service } = require('egg'); +const { Op } = require('sequelize'); + +/** 单次上报的条数上限(防止一次请求塞太多) */ +const MAX_BATCH = 500; +/** 字段长度(与 DDL 保持一致) */ +const MAX_CHANNEL_ID = 64; +const MAX_CHANNEL_NAME = 128; +const MAX_BARCODE = 255; + +/** 去掉首尾空白并把非字符串转成字符串 */ +function text(value) { + if (value === undefined || value === null) return ''; + return String(value).trim(); +} + +/** + * 解析扫描时间,统一截断到秒(去重键的一部分) + * + * 支持:`2026-10-16 12:00:00` / `2026-10-16T12:00:00` / `2026/10/16 12:00:00` + * / 10 位秒级时间戳 / 13 位毫秒级时间戳 / Date + * 无时区的字符串按**服务器本地时区**解析(与 Sequelize 的 +08:00 一致)。 + * + * @return {Date|null} 非法返回 null + */ +function parseScanTime(value) { + if (value === undefined || value === null || value === '') return null; + if (value instanceof Date) return Number.isNaN(value.getTime()) ? null : truncateToSecond(value); + + const str = text(value); + if (!str) return null; + + let date; + if (/^\d{10}$/.test(str)) { + date = new Date(Number(str) * 1000); // 秒级时间戳 + } else if (/^\d{13}$/.test(str)) { + date = new Date(Number(str)); // 毫秒级时间戳 + } else { + date = new Date(str.replace(/\//g, '-').replace(' ', 'T')); + } + + if (!date || Number.isNaN(date.getTime())) return null; + return truncateToSecond(date); +} + +function truncateToSecond(date) { + const copy = new Date(date.getTime()); + copy.setMilliseconds(0); + return copy; +} + +/** 唯一键冲突(重复上报)错误 */ +function isDuplicateError(err) { + if (!err) return false; + if (err.name === 'SequelizeUniqueConstraintError') return true; + if (err.parent && err.parent.code === 'ER_DUP_ENTRY') return true; + return err.code === 'ER_DUP_ENTRY'; +} + +/** 记录去重用的内存键 */ +function dedupKey(row) { + return [ row.scannerId, row.channelId, row.scanTime.getTime(), row.barcode ].join('\u0000'); +} + +function toInt(value) { + const num = Number(value); + return Number.isFinite(num) ? num : null; +} + +class ScanService extends Service { + get ScanChannel() { + return this.app.model.ScanChannel; + } + + get ScanRecord() { + return this.app.model.ScanRecord; + } + + /** + * 中控上报通道(channel_id + channel_name) + * + * - 同一中控 + 同一 channel_id 视为同一个通道:存在则更新通道名与最近上报时间; + * - 曾被软删除的通道会被「复活」(deleted_at 置空),避免唯一键挡住重新启用; + * - 同一次上报里重复的 channel_id 只处理最后一次。 + * + * @param {object} scanner 中控(扫描器实例,来自 scanner_auth) + * @param {Array} channels 形如 [{ channelId, channelName }] + * @return {Promise<{received:number, created:number, updated:number, invalid:number, errors:Array, channels:Array}>} + */ + async reportChannels(scanner, channels) { + const list = Array.isArray(channels) ? channels : []; + if (!list.length) this.ctx.throw(422, 'channels 不能为空'); + if (list.length > MAX_BATCH) this.ctx.throw(422, `单次最多上报 ${MAX_BATCH} 个通道`); + + const now = new Date(); + const errors = []; + const normalized = new Map(); // channelId -> { channelId, channelName } + + list.forEach((raw, index) => { + const item = raw && typeof raw === 'object' ? raw : {}; + const channelId = text(item.channelId || item.channel_id); + const channelName = text(item.channelName || item.channel_name); + if (!channelId) { + errors.push({ index, message: 'channelId 不能为空' }); + return; + } + if (channelId.length > MAX_CHANNEL_ID) { + errors.push({ index, message: `channelId 超长(>${MAX_CHANNEL_ID})` }); + return; + } + if (channelName.length > MAX_CHANNEL_NAME) { + errors.push({ index, message: `channelName 超长(>${MAX_CHANNEL_NAME})` }); + return; + } + // 同一次上报里同 channelId 只保留最后一次 + normalized.set(channelId, { channelId, channelName }); + }); + + const rows = [ ...normalized.values() ]; + if (!rows.length) { + return { received: list.length, created: 0, updated: 0, invalid: errors.length, errors, channels: [] }; + } + + const ids = rows.map(row => row.channelId); + const existing = await this.ScanChannel.findAll({ + where: { scannerId: scanner.id, channelId: { [Op.in]: ids } }, + paranoid: false, + }); + const existingMap = new Map(existing.map(row => [ row.channelId, row ])); + + let created = 0; + let updated = 0; + const saved = []; + + for (const row of rows) { + const hit = existingMap.get(row.channelId); + if (hit) { + if (hit.deletedAt) { + await this.ScanChannel.restore({ where: { id: hit.id } }); + this.ctx.logger.info('[scan] 通道 %s 已重新启用 (scanner=%s)', row.channelId, scanner.sn); + } + await this.ScanChannel.update( + { channelName: row.channelName, lastReportAt: now }, + { where: { id: hit.id }, paranoid: false }, + ); + updated++; + saved.push(Object.assign({ id: hit.id }, row, { lastReportAt: now })); + } else { + const instance = await this.ScanChannel.create({ + scannerId: scanner.id, + channelId: row.channelId, + channelName: row.channelName, + lastReportAt: now, + status: 1, + }); + created++; + saved.push(instance.toJSON()); + } + } + + this.ctx.logger.info('[scan] 通道上报 %s: 新增 %d / 更新 %d / 非法 %d', scanner.sn, created, updated, errors.length); + return { + received: list.length, + created, + updated, + invalid: errors.length, + errors, + channels: saved, + }; + } + + /** + * 中控上报扫码结果:条码 + 扫描时间 + 通道 id + * + * 去重:同一中控 + 同一通道 + 同一时间(秒) + 同一条码 只入库一次, + * 重复上报不报错,返回 { inserted, duplicated }。 + * 顺带:刷新通道的最近上报时间(未知通道自动补一条,通道名留空)、刷新中控心跳。 + * + * @param {object} scanner 中控(扫描器实例) + * @param {Array} records 形如 [{ barcode, scanTime, channelId }] + * @return {Promise} { received, inserted, duplicated, invalid, errors, unknownChannels } + */ + async ingest(scanner, records) { + const list = Array.isArray(records) ? records : []; + if (!list.length) this.ctx.throw(422, 'records 不能为空'); + if (list.length > MAX_BATCH) this.ctx.throw(422, `单次最多上报 ${MAX_BATCH} 条`); + + const now = new Date(); + const errors = []; + const rows = []; + const seen = new Set(); + + list.forEach((raw, index) => { + const item = raw && typeof raw === 'object' ? raw : {}; + const barcode = text(item.barcode || item.code); + const channelId = text(item.channelId || item.channel_id); + const scanTime = parseScanTime(item.scanTime || item.scan_time || item.time); + + if (!channelId) { + errors.push({ index, message: 'channelId 不能为空' }); + return; + } + if (channelId.length > MAX_CHANNEL_ID) { + errors.push({ index, message: `channelId 超长(>${MAX_CHANNEL_ID})` }); + return; + } + if (!barcode) { + errors.push({ index, message: 'barcode 不能为空' }); + return; + } + if (barcode.length > MAX_BARCODE) { + errors.push({ index, message: `barcode 超长(>${MAX_BARCODE})` }); + return; + } + if (!scanTime) { + errors.push({ index, message: 'scanTime 不能为空或格式非法' }); + return; + } + + const row = { scannerId: scanner.id, channelId, barcode, scanTime, reportedAt: now }; + // 同一批里完全相同的上报只留一条 + const key = dedupKey(row); + if (seen.has(key)) return; + seen.add(key); + rows.push(row); + }); + + const result = { + received: list.length, + inserted: 0, + duplicated: list.length - errors.length - rows.length, // 同一批内的重复条数 + invalid: errors.length, + errors, + unknownChannels: [], + }; + if (!rows.length) return result; + + const fresh = await this.filterExisting(rows); + result.duplicated += rows.length - fresh.length; + + if (fresh.length) { + try { + await this.ScanRecord.bulkCreate(fresh); + result.inserted = fresh.length; + } catch (err) { + if (!isDuplicateError(err)) throw err; + // 并发下正好撞上唯一键:退化成逐条插入,撞上的算重复 + for (const row of fresh) { + try { + await this.ScanRecord.create(row); + result.inserted++; + } catch (inner) { + if (!isDuplicateError(inner)) throw inner; + } + } + result.duplicated += fresh.length - result.inserted; + } + } + + const channelIds = [ ...new Set(rows.map(row => row.channelId)) ]; + result.unknownChannels = await this.touchChannels(scanner, channelIds, now); + // 有数据上报即视为中控在线,刷新心跳 + await this.ctx.service.scanner.heartbeat(scanner, this.ctx.ip); + + this.ctx.logger.info( + '[scan] 扫码上报 %s: 收到 %d / 入库 %d / 去重 %d / 非法 %d', + scanner.sn, result.received, result.inserted, result.duplicated, result.invalid, + ); + if (result.unknownChannels.length) { + this.ctx.logger.warn('[scan] %s 上报了未登记的通道: %s', scanner.sn, result.unknownChannels.join(', ')); + } + return result; + } + + /** + * 过滤掉库里已存在的记录(一次查询,按中控 + 时间范围 + 通道) + * @return {Promise} 需要新入库的行 + */ + async filterExisting(rows) { + const channelIds = [ ...new Set(rows.map(row => row.channelId)) ]; + const times = rows.map(row => row.scanTime.getTime()); + const from = new Date(Math.min(...times)); + const to = new Date(Math.max(...times)); + + const existing = await this.ScanRecord.findAll({ + attributes: [ 'scannerId', 'channelId', 'barcode', 'scanTime' ], + where: { + scannerId: rows[0].scannerId, + channelId: { [Op.in]: channelIds }, + scanTime: { [Op.between]: [ from, to ] }, + }, + raw: true, + }); + + const existingKeys = new Set(existing.map(row => dedupKey(Object.assign({}, row, { + scanTime: new Date(row.scanTime), + })))); + + return rows.filter(row => !existingKeys.has(dedupKey(row))); + } + + /** + * 刷新通道的最近上报时间;未登记的通道自动补一条(通道名留空) + * @return {Promise>} 自动补建的通道 id + */ + async touchChannels(scanner, channelIds, at = new Date()) { + if (!channelIds.length) return []; + + const known = await this.ScanChannel.findAll({ + attributes: [ 'channelId' ], + where: { scannerId: scanner.id, channelId: { [Op.in]: channelIds } }, + paranoid: false, + raw: true, + }); + const knownIds = new Set(known.map(row => row.channelId)); + const missing = channelIds.filter(id => !knownIds.has(id)); + + if (missing.length) { + await this.ScanChannel.bulkCreate(missing.map(channelId => ({ + scannerId: scanner.id, + channelId, + channelName: '', + lastReportAt: at, + status: 1, + }))); + } + + await this.ScanChannel.update( + { lastReportAt: at }, + { where: { scannerId: scanner.id, channelId: { [Op.in]: channelIds } }, paranoid: false }, + ); + + return missing; + } + + /** 通道列表(分页;可按中控 / 关键字过滤),带所属中控 */ + async listChannels({ page = 1, pageSize = 20, scannerId, keyword, status } = {}) { + const size = Math.min(Math.max(Number(pageSize) || 20, 1), 200); + const current = Math.max(Number(page) || 1, 1); + + const where = {}; + if (scannerId) where.scannerId = Number(scannerId); + if (status !== undefined && status !== '' && status !== null) where.status = Number(status); + if (keyword) { + where[Op.or] = [ + { channelId: { [Op.like]: `%${keyword}%` } }, + { channelName: { [Op.like]: `%${keyword}%` } }, + ]; + } + + const { rows, count } = await this.ScanChannel.findAndCountAll({ + where, + include: [{ model: this.app.model.Scanner, as: 'scanner', required: false, attributes: [ 'id', 'sn', 'name' ] }], + order: [[ 'scannerId', 'ASC' ], [ 'channelId', 'ASC' ]], + limit: size, + offset: (current - 1) * size, + }); + + return { + list: rows.map(row => row.toJSON()), + total: count, + page: current, + pageSize: size, + }; + } + + /** + * 扫码记录列表(分页 + 通道 / 条码 / 时间范围过滤),带所属中控 + * @param {object} params { page, pageSize, scannerId 单个中控, scannerIds 多个中控(用户端按「我的设备」过滤用), + * channelId, barcode, startTime, endTime } + */ + async listRecords({ page = 1, pageSize = 20, scannerId, scannerIds, channelId, barcode, startTime, endTime } = {}) { + const size = Math.min(Math.max(Number(pageSize) || 20, 1), 200); + const current = Math.max(Number(page) || 1, 1); + + const where = {}; + if (scannerId) where.scannerId = Number(scannerId); + if (scannerIds) where.scannerId = { [Op.in]: scannerIds.map(Number) }; + if (channelId) where.channelId = channelId; + if (barcode) where.barcode = { [Op.like]: `%${barcode}%` }; + + const from = parseScanTime(startTime); + const to = parseScanTime(endTime); + if (from || to) { + where.scanTime = {}; + if (from) where.scanTime[Op.gte] = from; + if (to) where.scanTime[Op.lte] = to; + } + + const { rows, count } = await this.ScanRecord.findAndCountAll({ + where, + include: [{ model: this.app.model.Scanner, as: 'scanner', required: false, attributes: [ 'id', 'sn', 'name' ] }], + order: [[ 'scanTime', 'DESC' ], [ 'id', 'DESC' ]], + limit: size, + offset: (current - 1) * size, + }); + + return { + list: rows.map(row => row.toJSON()), + total: count, + page: current, + pageSize: size, + }; + } + + /** + * 通道数(首页统计用) + * @param {object} where 普通条件;或 `{ scannerIds: [1,2] }` 限定这几个中控(用户端统计用) + */ + async countChannels({ scannerIds, ...where } = {}) { + if (scannerIds) where.scannerId = { [Op.in]: scannerIds.map(Number) }; + return this.ScanChannel.count({ where }); + } + + /** 扫码记录数(首页统计用;`{ scannerIds }` 限定中控,同 countChannels) */ + async countRecords({ scannerIds, ...where } = {}) { + if (scannerIds) where.scannerId = { [Op.in]: scannerIds.map(Number) }; + return this.ScanRecord.count({ where }); + } + + /** 某中控的通道(上报后回显用) */ + async findChannelsByScanner(scannerId) { + const rows = await this.ScanChannel.findAll({ + where: { scannerId }, + order: [[ 'channelId', 'ASC' ]], + }); + return rows.map(row => row.toJSON()); + } +} + +module.exports = ScanService; +module.exports.parseScanTime = parseScanTime; diff --git a/backend/app/service/scanner.js b/backend/app/service/scanner.js new file mode 100644 index 0000000..965d755 --- /dev/null +++ b/backend/app/service/scanner.js @@ -0,0 +1,271 @@ +'use strict'; + +const { Service } = require('egg'); +const { Op } = require('sequelize'); +const crypto = require('crypto'); + +/** + * 扫描器(设备)service + * + * 设备**只有一种身份**:扫码登录换来的长期 JWT —— + * `GET /api/device/login`(设备发码 → 手机确认)→ `loginByScan()` 建/取记录 + 签长期 JWT, + * 库里只存当前令牌的 `jti`(重签 → 旧令牌立即失效)。 + * 不再有「sn + secret 注册 / 登录」那套入口(`secret_hash` 列作为历史字段保留,不再写入)。 + */ + +/** 列表/详情默认不返回历史密钥字段与令牌标识 */ +const SAFE_ATTRIBUTES = { exclude: [ 'secretHash', 'tokenJti' ] }; +/** 关联用户时只带这几个展示字段 */ +const USER_ATTRIBUTES = [ 'id', 'username', 'nickname' ]; + +/** + * 输出前兜底清洗:历史密钥字段与令牌标识(jti)永不外泄 + * —— 即使 attributes 过滤被绕过(如单测 mock),这里也能兜住 + */ +function sanitize(row) { + if (!row) return row; + const { secretHash, tokenJti, ...rest } = row; + return rest; +} + +class ScannerService extends Service { + get Scanner() { + return this.app.model.Scanner; + } + + /** + * 设备扫码登录:**登录即注册**(`GET /api/device/login` 的唯一落地方法) + * + * - 按 SN 找不到记录 → 现场 `create` 一条,归属 = 扫码确认的那个用户(这就是「注册」); + * - 找到「无主」记录(`user_id` 为空)→ 由确认者**认领**(软删除的顺手复活); + * - 找到「已属于别人」的记录 → **403**,拒绝(避免扫一下就把别人的设备换绑走); + * - 设备被禁用(`status = 0`)→ 403; + * - 无论走哪条路径都换发长期 JWT(`jti` 轮换 → 旧令牌立即失效)。 + * + * ⚠️ 调用方必须已经确认过登录(`userId` 来自 `POST /api/wechat/confirm` 的确认人) + * + * @param {object} params { sn? 设备自报序列号(不传则服务端生成), name?, vendor?, model?, firmware?, + * userId 确认登录的用户, ip?, expiresIn? 令牌有效期(秒数,不传用 config.jwt.deviceExpiresIn) } + * @return {Promise} 扫描器信息 + token(JWT) + firstTime(本次是否新建记录) + */ + async loginByScan({ sn, name, vendor, model, firmware, userId, ip, expiresIn } = {}) { + if (!userId) this.ctx.throw(401, '缺少确认登录的用户'); + + const finalSn = String(sn || '').trim() || `DEV-${crypto.randomBytes(6).toString('hex').toUpperCase()}`; + const include = [{ model: this.app.model.User, as: 'user', required: false, attributes: USER_ATTRIBUTES }]; + + // 带上已删除的一起查:软删的行仍占着 sn 唯一键(否则下面 create 会撞键 500) + const existing = await this.Scanner.findOne({ + where: { sn: finalSn }, + attributes: SAFE_ATTRIBUTES, + include, + paranoid: false, + }); + + const payload = { userId: Number(userId), lastLoginAt: new Date(), lastSeenAt: new Date() }; + if (ip) payload.ip = ip; + if (name) payload.name = name; + if (vendor) payload.vendor = vendor; + if (model) payload.model = model; + if (firmware) payload.firmware = firmware; + + let scanner; + let firstTime = false; + + if (existing) { + // 已属于别的账号:拒绝(设备转让得先在原账号解绑) + if (existing.userId && Number(existing.userId) !== Number(userId)) { + this.ctx.logger.warn('[scanner] %s 已被用户 %s 绑定,拒绝用户 %s 的扫码登录', finalSn, existing.userId, userId); + this.ctx.throw(403, `扫描器 ${finalSn} 已绑定到其他账号,请先在原账号里解绑`); + } + if (Number(existing.status) !== 1) this.ctx.throw(403, '扫描器已被禁用'); + + if (existing.deletedAt) await existing.restore(); // 曾被删除 → 复活 + await existing.update(payload); + scanner = existing; + } else { + // 首次「注册」:扫码确认成功才建记录,归属就是确认登录的那个人 + firstTime = true; + scanner = await this.Scanner.create(Object.assign(payload, { + sn: finalSn, + lastRegisterAt: new Date(), + })); + } + + const token = await this.issueToken(scanner, { expiresIn }); + this.ctx.logger.info('[scanner] %s 扫码登录成功(%s,归属用户 %s)', + finalSn, firstTime ? '首次注册' : '已存在', userId); + + return Object.assign(sanitize(scanner.toJSON()), { + token, + tokenType: 'Bearer', + firstTime, + }); + } + + /** + * 签发长期 JWT 并把 jti 写库 + * 库里不保存令牌本体,靠 jti 比对实现撤销:重签后旧令牌立即失效 + * @param {object} scanner 扫描器实例 + * @param {object} options { expiresIn 覆盖有效期(秒数或 '30d' 写法,不传用 config.jwt.scannerExpiresIn) } + * @return {Promise} JWT + */ + async issueToken(scanner, options = {}) { + const jti = crypto.randomUUID(); + const token = this.ctx.service.jwt.signScanner(scanner, { jti }, { expiresIn: options.expiresIn }); + + await scanner.update({ + tokenJti: jti, + tokenExpiresAt: this.ctx.service.jwt.expiresAtOf(token), + }); + this.ctx.logger.info('[scanner] 已签发令牌: %s (jti=%s, expiresIn=%s)', + scanner.sn, jti, options.expiresIn || this.app.config.jwt.scannerExpiresIn); + return token; + } + + /** 鉴权用:取实例(含 jti,用于和令牌里的 jti 比对) */ + async findByIdForAuth(id) { + return this.Scanner.findByPk(id, { attributes: { include: [ 'tokenJti' ] } }); + } + + /** + * 用长期 JWT 换设备实例(校验链路与 `middleware/scanner_auth.js` 完全一致,实现在这里) + * + * 1. 验签 + 过期检查;2. 回查记录存在且 `status=1`;3. 比对库里的 jti(重签后旧令牌立即失效)。 + * 任何一步不过直接抛 401/403。 + * + * @param {string} token 长期 JWT + * @param {object} options { sn 额外要求令牌里的 SN 与它一致(测试页模拟上报用) } + * @return {Promise} 设备实例(含 tokenJti) + */ + async resolveByToken(token, { sn } = {}) { + if (!token) this.ctx.throw(401, '缺少扫描器令牌(Authorization: Bearer )'); + + const payload = this.ctx.service.jwt.verifyScanner(token); + const scanner = await this.findByIdForAuth(payload.sub); + + if (!scanner) this.ctx.throw(401, '扫描器不存在或已被删除'); + if (sn && scanner.sn !== String(sn).trim()) this.ctx.throw(401, '令牌与 SN 不匹配'); + if (Number(scanner.status) !== 1) this.ctx.throw(403, '扫描器已被禁用'); + if (payload.jti && scanner.tokenJti && payload.jti !== scanner.tokenJti) { + this.ctx.throw(401, '扫描器令牌已失效,请重新登录'); + } + + return scanner; + } + + /** 心跳:刷新最近心跳时间与 IP */ + async heartbeat(scanner, ip) { + const fields = { lastSeenAt: new Date() }; + if (ip) fields.ip = ip; + + await scanner.update(fields); + return sanitize(scanner.toJSON()); + } + + /** 绑定扫描器到账号(管理侧用:userId / username 二选一) */ + async bind({ scannerId, sn, userId, username }) { + const scanner = await this.findByKey({ scannerId, sn }); + if (!scanner) this.ctx.throw(404, '扫描器不存在'); + + const targetUserId = await this.resolveUserId({ userId, username }); + if (!targetUserId) this.ctx.throw(422, 'userId 或 username 至少提供一个'); + + await scanner.update({ userId: targetUserId }); + this.ctx.logger.info('[scanner] %s 绑定到用户 %s', scanner.sn, targetUserId); + return sanitize(scanner.toJSON()); + } + + /** 解绑(仅清掉归属关系,扫描器记录保留;设备可以再扫码重新认领) */ + async unbind({ scannerId, sn }) { + const scanner = await this.findByKey({ scannerId, sn }); + if (!scanner) return null; + + await scanner.update({ userId: null }); + return sanitize(scanner.toJSON()); + } + + /** 按主键 / SN 查扫描器 */ + async findByKey({ scannerId, sn }) { + if (scannerId) return this.Scanner.findByPk(scannerId); + if (sn) return this.Scanner.findOne({ where: { sn } }); + return null; + } + + async findById(id) { + const scanner = await this.Scanner.findByPk(id, { + attributes: SAFE_ATTRIBUTES, + include: [{ model: this.app.model.User, as: 'user', required: false, attributes: USER_ATTRIBUTES }], + }); + return scanner ? sanitize(scanner.toJSON()) : null; + } + + /** 分页列表:keyword 模糊匹配 SN / 名称 / 型号 */ + async list({ page = 1, pageSize = 20, keyword, userId, status } = {}) { + const size = Math.min(Number(pageSize) || 20, 100); + const current = Math.max(Number(page) || 1, 1); + + const where = {}; + if (userId) where.userId = Number(userId); + if (status !== undefined && status !== '' && status !== null) where.status = Number(status); + if (keyword) { + where[Op.or] = [ + { sn: { [Op.like]: `%${keyword}%` } }, + { name: { [Op.like]: `%${keyword}%` } }, + { model: { [Op.like]: `%${keyword}%` } }, + ]; + } + + const { rows, count } = await this.Scanner.findAndCountAll({ + where, + attributes: SAFE_ATTRIBUTES, + include: [{ model: this.app.model.User, as: 'user', required: false, attributes: USER_ATTRIBUTES }], + limit: size, + offset: (current - 1) * size, + order: [[ 'id', 'DESC' ]], + }); + + return { + list: rows.map(row => sanitize(row.toJSON())), + total: count, + page: current, + pageSize: size, + }; + } + + /** 软删除扫描器 */ + async remove(id) { + const affected = await this.Scanner.destroy({ where: { id } }); + return affected > 0; + } + + /** 总数(首页统计用) */ + async count(where = {}) { + return this.Scanner.count({ where }); + } + + /** + * 某用户名下的设备 id 列表(用户端查「我的通道 / 我的记录 / 我的统计」时用来限定范围) + * @return {Promise} + */ + async idsOfUser(userId) { + const rows = await this.Scanner.findAll({ + attributes: [ 'id' ], + where: { userId: Number(userId) }, + raw: true, + }); + return rows.map(row => row.id); + } + + /** userId / username(或手机号) → 用户 id,找不到抛 404 */ + async resolveUserId({ userId, username }) { + if (userId) return Number(userId); + if (!username) return null; + + const user = await this.ctx.service.user.findOneBy({ [Op.or]: [{ username }, { phone: username }] }); + if (!user) this.ctx.throw(404, `用户不存在:${username}`); + return user.id; + } +} + +module.exports = ScannerService; diff --git a/backend/app/service/user.js b/backend/app/service/user.js new file mode 100644 index 0000000..b8d8e0f --- /dev/null +++ b/backend/app/service/user.js @@ -0,0 +1,194 @@ +'use strict'; + +const { Service } = require('egg'); +const { Op } = require('sequelize'); + +const MAX_PAGE_SIZE = 100; +/** 允许创建/更新的字段白名单 */ +const WRITABLE_FIELDS = [ 'username', 'email', 'nickname', 'avatar', 'phone', 'gender', 'status', 'remark' ]; +/** 需要校验唯一性的字段 */ +const UNIQUE_FIELDS = [ 'username', 'phone', 'email' ]; +/** 默认查询字段:排除密码哈希,避免接口/模板意外外泄 */ +const SAFE_ATTRIBUTES = { exclude: [ 'passwordHash' ] }; + +/** 从查询结果里去掉密码哈希 */ +function sanitize(row) { + if (!row) return row; + const { passwordHash, ...rest } = row; + return rest; +} + +class UserService extends Service { + get User() { + return this.app.model.User; + } + + /** 按主键查询,返回普通对象;不存在返回 null */ + async findById(id) { + const user = await this.User.findByPk(id, { attributes: SAFE_ATTRIBUTES }); + return user ? user.toJSON() : null; + } + + /** 按用户名 / 手机号查询 */ + async findOneBy(where) { + const user = await this.User.findOne({ where, attributes: SAFE_ATTRIBUTES }); + return user ? user.toJSON() : null; + } + + /** + * 登录用:按用户名 / 手机号 / 邮箱查询,包含密码哈希(仅鉴权内部使用,不要外传) + * @return {Promise} Sequelize 实例 + */ + async findByAccount(account) { + return this.User.findOne({ + where: { [Op.or]: [{ username: account }, { phone: account }, { email: account }] }, + attributes: { include: [ 'passwordHash' ] }, + }); + } + + /** 写入密码哈希(哈希在 auth service 里生成) */ + async setPassword(id, passwordHash) { + const user = await this.User.findByPk(id); + if (!user) return false; + + await user.update({ passwordHash }); + return true; + } + + /** + * 按主键查询并带出密码哈希(仅改密码等鉴权场景内部使用,不要外传) + * @return {Promise} Sequelize 实例 + */ + async findByIdWithPassword(id) { + return this.User.findByPk(id, { attributes: { include: [ 'passwordHash' ] } }); + } + + /** 只保留登录态需要的字段(存 session / 回给页面) */ + toSafeUser(user) { + return { + id: user.id, + username: user.username, + nickname: user.nickname, + avatar: user.avatar, + phone: user.phone, + status: Number(user.status), + }; + } + + /** 总数(首页统计用) */ + async count(where = {}) { + return this.User.count({ where }); + } + + /** 通过微信授权反查用户(appid + openid) */ + async findByOpenid(appid, openid) { + const oauth = await this.app.model.WechatOauth.findOne({ + where: { appid, openid }, + include: [{ model: this.User, as: 'user', required: true, attributes: SAFE_ATTRIBUTES }], + }); + return oauth && oauth.user ? oauth.user.toJSON() : null; + } + + /** 分页查询:keyword 模糊匹配昵称 / 登录名 / 手机号 / 邮箱 */ + async list({ page = 1, pageSize = 20, keyword, status } = {}) { + const size = Math.min(Number(pageSize) || 20, MAX_PAGE_SIZE); + const current = Math.max(Number(page) || 1, 1); + + const where = {}; + if (status !== undefined && status !== '' && status !== null) { + where.status = Number(status); + } + if (keyword) { + where[Op.or] = [ + { nickname: { [Op.like]: `%${keyword}%` } }, + { username: { [Op.like]: `%${keyword}%` } }, + { phone: { [Op.like]: `%${keyword}%` } }, + { email: { [Op.like]: `%${keyword}%` } }, + ]; + } + + const { rows, count } = await this.User.findAndCountAll({ + where, + attributes: SAFE_ATTRIBUTES, + limit: size, + offset: (current - 1) * size, + order: [[ 'id', 'DESC' ]], + }); + + return { + list: rows.map(row => row.toJSON()), + total: count, + page: current, + pageSize: size, + }; + } + + /** 新增,返回完整记录 */ + async create(data) { + await this.assertUnique(data); + const user = await this.User.create(pick(data)); + return sanitize(user.toJSON()); + } + + /** 更新,返回更新后的记录;记录不存在返回 null */ + async update(id, data) { + const user = await this.User.findByPk(id); + if (!user) return null; + + await this.assertUnique(data, id); + const fields = pick(data); + if (Object.keys(fields).length) { + await user.update(fields); + } + return sanitize(user.toJSON()); + } + + /** 软删除,返回是否删除成功 */ + async remove(id) { + const affected = await this.User.destroy({ where: { id } }); + return affected > 0; + } + + /** 记录一次登录时间 */ + async touchLogin(id) { + const user = await this.User.findByPk(id); + if (!user) return null; + + await user.update({ lastLoginAt: new Date() }); + return user.toJSON(); + } + + /** username / phone 唯一性校验,冲突抛 409 */ + async assertUnique(data, excludeId) { + for (const field of UNIQUE_FIELDS) { + const value = data[field]; + if (value === undefined || value === null || value === '') continue; + + const where = { [field]: value }; + if (excludeId) where.id = { [Op.ne]: excludeId }; + + const exists = await this.User.findOne({ where }); + if (exists) this.ctx.throw(409, `${field} 已存在:${value}`); + } + } +} + +/** 只取白名单字段,并做基础类型归一化 */ +function pick(data = {}) { + const fields = {}; + for (const key of WRITABLE_FIELDS) { + if (data[key] === undefined) continue; + if (key === 'gender' || key === 'status') { + fields[key] = Number(data[key]); + } else if (key === 'phone' || key === 'email') { + // 空串统一存 NULL(唯一索引允许多个 NULL);邮箱还做小写归一 + const value = String(data[key] || '').trim(); + fields[key] = value ? (key === 'email' ? value.toLowerCase() : value) : null; + } else { + fields[key] = data[key]; + } + } + return fields; +} + +module.exports = UserService; diff --git a/backend/app/service/verify_code.js b/backend/app/service/verify_code.js new file mode 100644 index 0000000..2850780 --- /dev/null +++ b/backend/app/service/verify_code.js @@ -0,0 +1,116 @@ +'use strict'; + +const { Service } = require('egg'); + +/** 场景 → Redis key 段(不同场景的验证码互不影响) */ +const SCENES = { register: 'verify:register' }; + +/** 6 位数字验证码 */ +function randomCode() { + return String(Math.floor(Math.random() * 1000000)).padStart(6, '0'); +} + +/** + * 邮箱验证码:生成 / 校验 / 消费 + * + * 存在 Redis: + * - `packs:verify::` 验证码本身(TTL = config.email.codeTtl,默认 10 分钟) + * - `packs:verify:::sent` 重发节流标记(SET NX,TTL = resendInterval,默认 60 秒) + * - `packs:verify:::try` 错误次数(超过 maxAttempts 作废验证码) + * + * 对外不抛异常,统一返回 `{ ok, message }`,方便页面回提示(不弹 500)。 + */ +class VerifyCodeService extends Service { + get redis() { + return this.app.redis; + } + + get cfg() { + return this.app.config.email; + } + + keyOf(scene, email) { + const segment = SCENES[scene] || scene; + return `${this.app.config.cache.prefix}${segment}:${email}`; + } + + /** + * 生成验证码并发邮件 + * @param {string} scene 场景(register) + * @param {string} email 邮箱(调用方保证已小写归一) + * @return {Promise<{ok:boolean, message?:string, code?:string, devMode?:boolean, ttl?:number, resendInterval?:number}>} + */ + async send(scene, email) { + if (!this.redis) return { ok: false, message: '验证码服务不可用(Redis 未就绪)' }; + + const key = this.keyOf(scene, email); + try { + // 重发节流:SET NX 原子占位,间隔内只允许发一次 + const locked = await this.redis.set(`${key}:sent`, '1', 'EX', this.cfg.resendInterval, 'NX'); + if (locked !== 'OK') { + return { ok: false, message: `验证码已发送,请 ${this.cfg.resendInterval} 秒后再试` }; + } + + const code = randomCode(); + await this.redis.setex(key, this.cfg.codeTtl, code); + await this.redis.del(`${key}:try`); + + const mail = await this.ctx.service.mail.sendVerifyCode(email, code, { ttl: this.cfg.codeTtl }); + if (mail.failed) { + await this.redis.del(`${key}:sent`); // 发失败就不要占着节流位 + return { ok: false, message: '验证码邮件发送失败,请稍后再试' }; + } + + this.ctx.logger.info('[verify] %s 验证码已生成: %s (devMode=%s)', scene, email, !!mail.devMode); + return { + ok: true, + ttl: this.cfg.codeTtl, + resendInterval: this.cfg.resendInterval, + devMode: !!mail.devMode, + // 开发模式才把验证码回传给页面(生产走邮件) + code: mail.devMode ? code : undefined, + }; + } catch (err) { + this.ctx.logger.error('[verify] 验证码发送失败 %s : %s', email, err.message); + return { ok: false, message: '验证码服务暂不可用,请稍后再试' }; + } + } + + /** + * 校验验证码(不消费,注册成功后再 consume,这样用户名冲突时可以改完重提) + * @return {Promise<{ok:boolean, message?:string}>} + */ + async check(scene, email, code) { + if (!this.redis) return { ok: false, message: '验证码服务不可用(Redis 未就绪)' }; + + const key = this.keyOf(scene, email); + try { + const expect = await this.redis.get(key); + if (!expect) return { ok: false, message: '验证码已过期,请重新获取' }; + + const tries = await this.redis.incr(`${key}:try`); + await this.redis.expire(`${key}:try`, this.cfg.codeTtl); + if (tries > this.cfg.maxAttempts) { + await this.redis.del(key); + return { ok: false, message: '验证码错误次数过多,请重新获取' }; + } + if (String(code) !== String(expect)) { + return { ok: false, message: '邮箱验证码不正确' }; + } + return { ok: true }; + } catch (err) { + this.ctx.logger.error('[verify] 验证码校验失败 %s : %s', email, err.message); + return { ok: false, message: '验证码服务暂不可用,请稍后再试' }; + } + } + + /** 消费掉验证码(注册成功后调用) */ + async consume(scene, email) { + if (!this.redis) return; + const key = this.keyOf(scene, email); + await this.redis.del(key); + await this.redis.del(`${key}:try`); + } +} + +module.exports = VerifyCodeService; diff --git a/backend/app/service/wechat.js b/backend/app/service/wechat.js new file mode 100644 index 0000000..fdf4b49 --- /dev/null +++ b/backend/app/service/wechat.js @@ -0,0 +1,97 @@ +'use strict'; + +const { Service } = require('egg'); + +/** 拼装写库的授权信息(只写入明确传入的字段,避免把旧值覆盖成空) */ +function buildPayload(data) { + const payload = {}; + if (data.unionid !== undefined) payload.unionid = data.unionid || null; + if (data.nickname !== undefined) payload.nickname = data.nickname || ''; + if (data.avatar !== undefined) payload.avatar = data.avatar || ''; + if (data.sessionKey !== undefined) payload.sessionKey = data.sessionKey || null; + if (data.accessToken !== undefined) payload.accessToken = data.accessToken || null; + if (data.refreshToken !== undefined) payload.refreshToken = data.refreshToken || null; + if (data.scope !== undefined) payload.scope = data.scope || null; + if (data.expiresIn !== undefined && data.expiresIn !== null) { + payload.tokenExpiresAt = new Date(Date.now() + Number(data.expiresIn) * 1000); + } else if (data.tokenExpiresAt !== undefined) { + payload.tokenExpiresAt = data.tokenExpiresAt; + } + payload.lastAuthAt = new Date(); + return payload; +} + +class WechatService extends Service { + get WechatOauth() { + return this.app.model.WechatOauth; + } + + /** + * 绑定微信授权:同一 appid + openid 已存在则更新,否则新建 + * @param {object} data userId / appid / openid 必填 + */ + async bind(data) { + const { userId, appid, openid } = data; + const existing = await this.WechatOauth.findOne({ where: { appid, openid } }); + const payload = buildPayload(data); + + if (existing) { + // 换绑:允许把已存在的授权记录改到另一个用户 + if (userId && Number(existing.userId) !== Number(userId)) { + payload.userId = userId; + } + await existing.update(payload); + return existing.toJSON(); + } + + const created = await this.WechatOauth.create(Object.assign({ userId, appid, openid }, payload)); + return created.toJSON(); + } + + /** 按 appid + openid 查询授权记录,并带出关联用户 */ + async findByOpenid(appid, openid) { + const oauth = await this.WechatOauth.findOne({ + where: { appid, openid }, + include: [{ model: this.app.model.User, as: 'user', required: false }], + }); + if (!oauth) return null; + + const result = oauth.toJSON(); + if (result.user) { + // 不把用户敏感字段透出去 + delete result.user.deleted_at; + } + return result; + } + + /** 查询某个用户的全部微信授权 */ + async listByUser(userId) { + const rows = await this.WechatOauth.findAll({ + where: { userId }, + order: [[ 'id', 'DESC' ]], + }); + return rows.map(row => row.toJSON()); + } + + /** 更新小程序 session_key / 令牌 */ + async updateTokens(id, data) { + const oauth = await this.WechatOauth.findByPk(id); + if (!oauth) return null; + + await oauth.update(buildPayload(data)); + return oauth.toJSON(); + } + + /** 解绑(软删除) */ + async unbind(id) { + const affected = await this.WechatOauth.destroy({ where: { id } }); + return affected > 0; + } + + /** 总数(首页统计用) */ + async count(where = {}) { + return this.WechatOauth.count({ where }); + } +} + +module.exports = WechatService; diff --git a/backend/app/service/wechat_login.js b/backend/app/service/wechat_login.js new file mode 100644 index 0000000..4c657f8 --- /dev/null +++ b/backend/app/service/wechat_login.js @@ -0,0 +1,499 @@ +'use strict'; + +const { Service } = require('egg'); +const crypto = require('crypto'); +const qrcode = require('qrcode-generator'); + +/** 扫码串码字符集:数字 + 大写字母,去掉了 0/O/1/I 等容易看错的字符 */ +const CODE_ALPHABET = '23456789ABCDEFGHJKLMNPQRSTUVWXYZ'; + +/** 生成 6 位数字 + 字母的随机串码 */ +function randomCode(length = 6) { + let out = ''; + for (let i = 0; i < length; i++) { + out += CODE_ALPHABET[crypto.randomInt(CODE_ALPHABET.length)]; + } + return out; +} + +/** + * 微信公众号「网页授权」地址(在微信内置浏览器里打开时用,scope=snsapi_base 静默拿 openid) + * 手机扫码后先落到本站 `/wechat?spm=…`,再重定向到这里。 + */ +function webAuthorizeUrl({ appid, redirectUri, state }) { + const query = new URLSearchParams({ + appid, + redirect_uri: redirectUri, + response_type: 'code', + scope: 'snsapi_base', + state, + }); + return `https://open.weixin.qq.com/connect/oauth2/authorize?${query.toString()}#wechat_redirect`; +} + +/** + * 登录页的微信扫码登录 + * + * - **二维码内容是本站地址**:`http://<域名>/wechat?spm=1.0..1`,`` 是服务端生成的 + * 6 位数字 + 字母随机串码(存 Redis,TTL 内有效);二维码本身用零依赖的 qrcode-generator + * 现场画成 SVG(`/api/wechat/qrcode.svg`),**全程不加载任何第三方图片/脚本**。 + * - **扫码后**:手机打开**前端路由** `/wechat?spm=…` → 配了微信就重定向到公众号网页授权(静默拿 openid), + * 回到后端 `/api/wechat/callback` 后把「已确认的用户 id」写进 Redis; + * 没配微信时退化成「手机确认登录」——扫码的人已经登录才能确认(`POST /api/wechat/confirm`)。 + * - **不自动建号**:只对「已绑定微信」的账号生效(绑定关系在 `wechat_oauth` 表里, + * 可用 `POST /api/wechat/bind` 建立),未绑定就提示先用账号密码登录再绑定。 + * - 串码一次性:确认结果被电脑端取走后立即删除。 + */ +class WechatLoginService extends Service { + get cfg() { + return this.app.config.wechat; + } + + get redis() { + return this.app.redis; + } + + /** 是否配好了微信登录 */ + get enabled() { + return Boolean(this.cfg.appid && this.cfg.secret); + } + + /** 扫码状态在 Redis 里的 key(value:'pending' = 等扫码;数字 = 已确认的用户 id) */ + stateKey(code) { + return `${this.app.config.cache.prefix}wechat:state:${code}`; + } + + /** 长轮询用的广播频道 */ + channel(code) { + return `${this.app.config.cache.prefix}wechat:login:${code}`; + } + + /** 设备专用登录:设备自报信息(sn / 名称等)的暂存 key(发码时写入,确认/换码时取走) */ + deviceKey(code) { + return `${this.app.config.cache.prefix}device:info:${code}`; + } + + /** + * 暂存设备自报信息(发码时调用;什么都没传就不写) + * + * 建记录发生在「扫码确认成功」那一刻,而设备可能只在发码时带了 sn/名称 —— + * 存一份就能在确认/换码时沿用,不用要求设备每次都把参数补齐 + * @param {string} code 登录码 + * @param {object} info { sn, name, vendor, model, firmware } + */ + async saveDeviceInfo(code, info = {}) { + if (!this.redis || !code) return; + + const payload = {}; + for (const key of [ 'sn', 'name', 'vendor', 'model', 'firmware' ]) { + if (info[key]) payload[key] = info[key]; + } + if (!Object.keys(payload).length) return; + + try { + await this.redis.setex(this.deviceKey(code), this.stateTtl, JSON.stringify(payload)); + } catch (err) { + this.ctx.logger.warn('[wechat] 暂存设备信息失败: %s', err.message); + } + } + + /** 取走设备自报信息(确认成功 / 换码时调用,取走即删),取不到返回 null */ + async takeDeviceInfo(code) { + if (!this.redis || !code) return null; + try { + const raw = await this.redis.get(this.deviceKey(code)); + await this.redis.del(this.deviceKey(code)); + return raw ? JSON.parse(raw) : null; + } catch (err) { + this.ctx.logger.warn('[wechat] 读取设备信息失败: %s', err.message); + return null; + } + } + + /** + * 回调地址:优先用配置,否则按当前请求的 origin 拼 + * (这是**后端**地址,微信授权后会带 ?code=&state= 重定向到这里,见 controller/auth/wechat.js#callback) + */ + redirectUri(origin) { + if (this.cfg.redirectUri) return this.cfg.redirectUri; + return `${String(origin || '').replace(/\/+$/, '')}/api/wechat/callback`; + } + + /** 把串码拼成 spm(默认 `1.0..1`,格式可用 `WECHAT_SPM_PATTERN` 配) */ + spm(code) { + return String(this.cfg.spmPattern || '1.0.{code}.1').replace('{code}', code); + } + + /** 从 spm 里把串码抠出来(`1.0.AB12CD.1` → `AB12CD`),格式不对返回空串 */ + parseSpm(spm) { + const length = Number(this.cfg.codeLength || 6); + const pattern = new RegExp(`^[0-9A-Za-z]{${length}}$`); + for (const seg of String(spm || '').split('.')) { + if (pattern.test(seg)) return seg.toUpperCase(); + } + return ''; + } + + /** + * 二维码里要编码的内容:本站 `/wechat?spm=1.0..1`(前端的 origin 由请求带) + * @param {object} params { code, origin } + * @return {string} + */ + qrContent({ code, origin } = {}) { + if (!code) this.ctx.throw(422, '缺少登录码'); + return `${String(origin || '').replace(/\/+$/, '')}/wechat?spm=${this.spm(code)}`; + } + + /** 公众号网页授权地址(手机在微信里打开 `/wechat?spm=…` 时重定向过去) */ + oauthAuthorizeUrl({ origin, code }) { + return webAuthorizeUrl({ + appid: this.cfg.appid, + redirectUri: this.redirectUri(origin), + state: code, + }); + } + + /** 这个串码还在等扫码吗(存在且是 pending) */ + async isPending(code) { + if (!this.redis || !code) return false; + try { + return await this.redis.get(this.stateKey(code)) === 'pending'; + } catch (err) { + this.ctx.logger.warn('[wechat] 查询扫码状态失败: %s', err.message); + return false; + } + } + + /** + * 给前端 API 用:生成一个新串码并登记为 pending(不依赖 session) + * @return {Promise} 6 位串码 + */ + async newCode() { + const code = randomCode(Number(this.cfg.codeLength || 6)); + await this.openState(code); + return code; + } + + /** + * 给前端 API 用:轮询串码状态(**长轮询**) + * + * 行为: + * - 已经确认过 → 立刻返回 `{ status:'confirmed', user, token, … }`(取走即删,一次性); + * - 串码不存在/已过期 → 立刻返回 `{ status:'refreshed', code }`(附新串码,前端直接换二维码); + * - 还在等扫码 → 挂起最多 `wait` 秒(受 `WECHAT_POLL_WAIT` 限制): + * - 期间有人确认 → **立即**返回 `confirmed`(靠 Redis 发布订阅通知,不轮询); * - 客户端提前断开(切回账号密码登录 / 关页签 / fetch abort)→ 立即返回 `{ status:'aborted' }`, + * **不再挂满 wait 秒**,也不把串码换掉; * - 到时间没动静 → 返回 `{ status:'refreshed', code }` 换一张新码; + * - `wait=0`(默认)时不挂起,只返回 `{ status:'pending' }`。 + * + * @param {string} code 串码 + * @param {object} options { wait 挂起秒数, withToken 是否顺手签发用户 JWT(设备端登录时为 false, + * 由调用方自己签发长期令牌,见 app/controller/device.js)} + * @return {Promise<{status:string, user?:object, token?:string, code?:string, waited?:number}>} + */ + async awaitLogin(code, { wait = 0, withToken = true } = {}) { + if (!this.redis || !code) { + return { status: 'refreshed', code: await this.newCode() }; + } + + const maxWait = Number(this.cfg.pollWait || 25); + const seconds = Math.min(Math.max(Number(wait) || 0, 0), maxWait); + const channel = this.channel(code); + + // 先订阅、再查状态:这样「查的时候还是 pending、随后立刻被确认」的那一下不会漏掉 + const subscriber = seconds > 0 ? this.subscriber() : null; + if (subscriber) await subscriber.subscribe(channel); + + // 客户端断开的信号:页面导航(切回账号密码登录)或前端 abort 时立刻结束等待 + const closed = seconds > 0 ? this.clientClosed() : null; + + try { + const login = await this.takeLogin(code, withToken); + if (login) return Object.assign({ status: 'confirmed' }, login); + + if (!(await this.isPending(code))) { + return { status: 'refreshed', code: await this.newCode() }; + } + if (!seconds) return { status: 'pending' }; + + const hit = await this.waitPublish(subscriber, seconds * 1000, closed); + if (hit === 'closed') { + this.ctx.logger.info('[wechat] 客户端已断开,停止等待串码 %s', code); + return { status: 'aborted' }; + } + if (hit) { + const after = await this.takeLogin(code, withToken); + if (after) return Object.assign({ status: 'confirmed' }, after); + } + // 到时间还没人扫 → 直接给新码,让前端换二维码 + this.ctx.logger.info('[wechat] 串码 %s 等待 %ss 无变化,换新码', code, seconds); + return { status: 'refreshed', code: await this.newCode(), waited: seconds }; + } finally { + if (subscriber) subscriber.disconnect(); + } + } + + /** + * 取走确认结果(`withToken=false` 时只给用户,不签用户 JWT) + * 设备端扫码登录用它取用户,再自己签发**长期**扫描器令牌 + * @param {string} code 串码 + * @param {boolean} withToken 是否顺手签发用户 JWT + * @return {Promise<{user:object, token?:string, tokenType?:string, expiresIn?:string}|null>} + */ + async takeLogin(code, withToken = true) { + if (withToken) return this.takeConfirmedWithToken(code); + + const user = await this.takeConfirmed(code); + return user ? { user } : null; + } + + /** + * 取走确认结果,顺手签发用户 JWT(写 session / 返回前端都用这一份) + * @param {string} code 串码 + * @return {Promise<{user:object, token:string, tokenType:string, expiresIn:string}|null>} + */ + async takeConfirmedWithToken(code) { + const user = await this.takeConfirmed(code); + if (!user) return null; + return { + user, + token: this.ctx.service.jwt.signUser(user), + tokenType: 'Bearer', + expiresIn: this.app.config.jwt.userExpiresIn, + }; + } + + /** 确认登录后广播一次(长轮询的请求靠它立即醒来) */ + async notify(code) { + if (!this.redis) return; + try { + await this.redis.publish(this.channel(code), 'confirmed'); + } catch (err) { + this.ctx.logger.warn('[wechat] 广播确认失败: %s', err.message); + } + } + + /** 订阅用的独立连接(duplicate 出来的,用完即 disconnect) */ + subscriber() { + const redis = this.app.redis; + return typeof redis.duplicate === 'function' ? redis.duplicate() : null; + } + + /** + * 客户端断开(页面导航 / fetch abort)时 resolve `'closed'` 的 promise,拿不到底层连接时返回 null + * 用途:长轮询没人在等了就别再挂满 wait 秒(也避免白换一张新码) + */ + clientClosed() { + const res = this.ctx && this.ctx.res; + if (!res || typeof res.on !== 'function') return null; + + return new Promise(resolve => { + const onClose = () => { + res.removeListener('close', onClose); + // 响应正常写完后 close 也会触发,那种不算断开 + if (!res.writableEnded) resolve('closed'); + }; + res.on('close', onClose); + }); + } + + /** 等一条消息(或超时返回 null;`closed` 提前 resolve 就返回 'closed') */ + waitPublish(subscriber, waitMs, closed) { + const wait = new Promise(resolve => { + if (!subscriber) return setTimeout(() => resolve(null), waitMs); + let done = false; + const finish = (value) => { + if (done) return; + done = true; + clearTimeout(timer); + resolve(value); + }; + const timer = setTimeout(() => finish(null), waitMs); + subscriber.on('message', () => finish('confirmed')); + }); + + return closed ? Promise.race([ wait, closed ]) : wait; + } + + /** 读串码当前的值:'pending' / 用户 id / null(不存在或已过期) */ + async valueOf(code) { + if (!this.redis || !code) return null; + try { + return await this.redis.get(this.stateKey(code)); + } catch (err) { + this.ctx.logger.warn('[wechat] 读取串码失败: %s', err.message); + return null; + } + } + + /** + * 确认登录(把「谁登录」写进 Redis 等电脑端取走) + * @param {string} code 串码 + * @param {number} userId 确认者的用户 id(调用方保证已登录) + * @return {Promise<{ok:boolean, reason?:string, message?:string}>} + * reason: no_redis(Redis 不可用)/ bad_param(参数不全)/ expired(码不存在或已过期)/ used(已经被用过) + */ + async confirm(code, userId) { + if (!this.redis) return { ok: false, reason: 'no_redis', message: '服务暂时不可用,请稍后再试' }; + if (!code || !userId) return { ok: false, reason: 'bad_param', message: '参数不完整' }; + + const value = await this.valueOf(code); + if (!value) return { ok: false, reason: 'expired', message: '登录码已失效,请刷新后重新扫码' }; + if (value !== 'pending') return { ok: false, reason: 'used', message: '该登录码已经用过了' }; + + await this.redis.setex(this.stateKey(code), this.stateTtl, String(userId)); + await this.notify(code); // 写完立刻广播:正在长轮询的请求马上就能返回 + this.ctx.logger.info('[wechat] 扫码确认登录: code=%s userId=%s', code, userId); + return { ok: true }; + } + + /** + * 串码当前状态(给小程序/前端查询用,无副作用) + * @param {string} code 串码 + * @return {Promise<{status:string, expiresIn:number}>} + * pending(待扫码)/ confirmed(已被确认,等电脑端取走)/ expired(不存在或已过期) + */ + async statusOf(code) { + const value = await this.valueOf(code); + if (!value) return { status: 'expired', expiresIn: 0 }; + return { + status: value === 'pending' ? 'pending' : 'confirmed', + expiresIn: await this.ttlOf(code), + }; + } + + /** 串码剩余有效期(秒),取不到返回 0 */ + async ttlOf(code) { + if (!this.redis || !code) return 0; + try { + const ttl = Number(await this.redis.ttl(this.stateKey(code))); + return ttl > 0 ? ttl : 0; + } catch (err) { + this.ctx.logger.warn('[wechat] 读取串码有效期失败: %s', err.message); + return 0; + } + } + + /** + * 本地把内容画成二维码 SVG(零依赖库,不请求外部服务) + * ⚠️ qrcode-generator 的 margin 参数单位是**像素**(不是格),所以这里把「格」换算成像素: + * 默认 4 格静默区(QR 规范要求 ≥ 4 格,不够会影响扫码识别率)。 + * @param {string} content 编码内容 + * @return {string} SVG 源码 + */ + qrSvg(content) { + const cellSize = this.cfg.qrCellSize; + const qr = qrcode(0, 'M'); // 版本自动、纠错等级 M + qr.addData(String(content)); + qr.make(); + return qr.createSvgTag({ + cellSize, + margin: this.cfg.qrMargin * cellSize, + scalable: true, + }); + } + + /** 用 code 换 openid(只有配好 appid/secret 才会走到这里) */ + async exchangeCode(code) { + const apiBase = String(this.cfg.apiBase || 'https://api.weixin.qq.com').replace(/\/+$/, ''); + const res = await this.ctx.curl(`${apiBase}/sns/oauth2/access_token`, { + method: 'GET', + data: { + appid: this.cfg.appid, + secret: this.cfg.secret, + code, + grant_type: 'authorization_code', + }, + dataType: 'json', + timeout: 5000, + }); + const data = res.data || {}; + if (data.errcode) { + this.ctx.logger.warn('[wechat] 换 openid 失败: %s %s', data.errcode, data.errmsg); + return { ok: false, message: `微信返回错误(${data.errcode}):${data.errmsg || '未知'}` }; + } + if (!data.openid) { + this.ctx.logger.warn('[wechat] 微信未返回 openid: %j', data); + return { ok: false, message: '微信未返回 openid,请重试' }; + } + return { ok: true, openid: data.openid, unionid: data.unionid || null }; + } + + /** + * 扫码后微信授权回来的处理(在**扫码那台设备**上执行):串码存在 → 换 openid → 找已绑定账号 → + * 把「已确认的用户 id」写进 Redis(key 就是串码),等电脑端登录页轮询取走。 + * @param {string} code 微信回传的 code(换 openid 用) + * @param {string} state 微信回传的 state(= 本次扫码的 6 位串码) + * @return {Promise<{ok:boolean, message?:string, user?:object}>} + */ + async login(code, state) { + if (!this.enabled) { + return { ok: false, message: '服务端未配置微信登录(WECHAT_APPID / WECHAT_SECRET)' }; + } + if (!state || !this.redis) { + return { ok: false, message: '登录状态已失效,请重新扫码' }; + } + + let pending; + try { + pending = await this.redis.get(this.stateKey(state)); + } catch (err) { + this.ctx.logger.error('[wechat] 读取扫码状态失败: %s', err.message); + return { ok: false, message: '服务暂时不可用,请稍后再试' }; + } + if (!pending) return { ok: false, message: '二维码已过期,请重新扫码' }; + if (!code) return { ok: false, message: '微信未回传 code,请重新扫码' }; + + const exchanged = await this.exchangeCode(code); + if (!exchanged.ok) return exchanged; + + const user = await this.ctx.service.user.findByOpenid(this.cfg.appid, exchanged.openid); + if (!user) { + this.ctx.logger.info('[wechat] openid 未绑定任何账号: %s', exchanged.openid); + return { ok: false, message: '这个微信还没绑定账号,请先用账号密码登录,绑定微信后再扫码' }; + } + if (Number(user.status) !== 1) { + return { ok: false, message: '账号已被禁用,请联系管理员' }; + } + + await this.redis.setex(this.stateKey(state), this.stateTtl, String(user.id)); + await this.notify(state); // 长轮询的请求靠这条广播立即醒来 + this.ctx.logger.info('[wechat] 扫码确认成功: %s (id=%s)', user.username, user.id); + return { ok: true, user }; + } + + /** state 有效期(秒):与二维码有效期一致 */ + get stateTtl() { + return Number(this.cfg.stateTtl || 600); + } + + /** 登记一个待扫码的 state(桌面端渲染二维码时调用,重复调用只是刷新有效期) */ + async openState(state) { + if (!this.redis) return; + try { + await this.redis.setex(this.stateKey(state), this.stateTtl, 'pending'); + } catch (err) { + this.ctx.logger.warn('[wechat] 登记扫码状态失败: %s', err.message); + } + } + + /** + * 取走已确认的登录(桌面端轮询时调用) + * @return {Promise} 已确认的用户,未确认/已过期返回 null + */ + async takeConfirmed(state) { + if (!this.redis || !state) return null; + let value; + try { + value = await this.redis.get(this.stateKey(state)); + } catch (err) { + this.ctx.logger.warn('[wechat] 查询扫码状态失败: %s', err.message); + return null; + } + if (!value || value === 'pending') return null; + + await this.redis.del(this.stateKey(state)); // 一次性,用完即失效 + return this.ctx.service.user.findById(Number(value)); + } +} + +module.exports = WechatLoginService; diff --git a/backend/config/config.default.js b/backend/config/config.default.js new file mode 100644 index 0000000..90c8604 --- /dev/null +++ b/backend/config/config.default.js @@ -0,0 +1,206 @@ +'use strict'; + +const path = require('path'); + +const { env } = process; + +/** + * 默认配置(所有环境生效),按环境差异请放到 config.{env}.js 覆盖 + * @param {Egg.EggAppInfo} appInfo app 信息 + */ +module.exports = (appInfo) => { + const config = (exports = {}); + + // cookie/session 签名用的 key,生产环境请改成随机字符串 + config.keys = `${appInfo.name}_1729000000000_1971`; + + // ==================== 站点/产品名 ==================== + // 页标题、品牌位、邮件正文都用它 —— **改名字只改这里**(或设环境变量 SITE_NAME) + config.siteName = env.SITE_NAME || '云仓视频溯源系统'; + + // 中间件(app/middleware/xxx.js 后写 'xxx') + // errorHandler:接口异常统一返回 JSON + // frontend:**后端不渲染页面** —— 开发时把页面请求反代给前端 dev server,生产时托管前端构建产物 + config.middleware = [ 'errorHandler', 'frontend' ]; + + // ==================== 前端入口(页面不在后端渲染) ==================== + // 开发(env=local):页面请求(非 /api、/health)反代到前端 dev server(frontend/ 里 npm run dev) + // 生产:直接托管前端构建产物 dist(SPA 深链回退到 index.html) + // 联调时只开一个地址:打开 http://127.0.0.1:7001 就是前端页面 + config.frontend = { + enable: !/^(0|false|no|off)$/i.test(String(env.FRONTEND_ENABLE || 'true')), + devServer: env.FRONTEND_DEV_SERVER || 'http://127.0.0.1:7301', + distDir: env.FRONTEND_DIST || path.join(appInfo.baseDir, '../frontend/dist'), + }; + + // ==================== 运维/内部接口鉴权 ==================== + // 对应 app/middleware/internal_auth.js: + // - token:给运维脚本 / 后台系统用(header `X-Internal-Token`);**不配则一律不认** + // - adminIds:允许访问内部接口的账号 id(user JWT 的 sub),默认 [1](内置管理员) + config.internal = { + token: env.INTERNAL_TOKEN || '', + adminIds: String(env.INTERNAL_ADMIN_IDS || '1') + .split(',') + .map(value => Number(value.trim())) + .filter(id => Number.isInteger(id) && id > 0), + }; + + // ==================== 服务端口 ==================== + // 本地默认 7001;“专用测试端口”用 `npm run dev:test`(egg-bin dev --port 7300) + // 也可临时覆盖:PORT=7300 npm run dev(PowerShell:$env:PORT=7300; npm run dev) + config.cluster = { + listen: { + port: Number(env.PORT || 7001), + }, + }; + + // 多实例并存时用 LOG_DIR 把日志分到不同目录 + // (具体生效位置见文件末尾:这里先不设,避开下面的 config.logger 赋值) + + // ==================== 安全 ==================== + // 前端是 SPA + **header 令牌**,后端没有任何基于 cookie/session 的表单: + // CSRF 保护(只对 cookie 会话有意义)整个关掉,登录响应里那个多余的 csrfToken cookie 也随之消失。 + config.security = { + csrf: { + enable: false, + }, + }; + + // ==================== MySQL ==================== + // ==================== MySQL(Sequelize ORM) ==================== + // 模型定义在 app/model/ 下,通过 app.model.User / ctx.model.User 访问 + config.sequelize = { + dialect: 'mysql', + host: env.MYSQL_HOST || '127.0.0.1', + port: Number(env.MYSQL_PORT || 3307), + // 注意:账号名大小写敏感,必须是 packservice + username: env.MYSQL_USER || 'packservice', + // 密码不要写在这里,放 config.local.js 或环境变量 MYSQL_PASSWORD + password: env.MYSQL_PASSWORD || '', + database: env.MYSQL_DATABASE || 'packservice', + // 固定时区,避免服务器时区不同导致时间偏移 + timezone: '+08:00', + charset: 'utf8mb4', + define: { + // 表名用单数形式(不自动加 s) + freezeTableName: true, + // 驼峰属性映射到下划线字段 + underscored: true, + createdAt: 'created_at', + updatedAt: 'updated_at', + }, + pool: { + max: Number(env.MYSQL_POOL_SIZE || 10), + min: 0, + acquire: 30000, + idle: 10000, + }, + // 需要打印 SQL 时改成 console.log(或自定义 logger) + logging: false, + // 只读从库 / 多数据源可改用 datasources 配置 + }; + + // ==================== Redis ==================== + config.redis = { + client: { + host: env.REDIS_HOST || '127.0.0.1', + port: Number(env.REDIS_PORT || 6379), + // 无密码必须显式写 null + password: env.REDIS_PASSWORD || null, + db: Number(env.REDIS_DB || 0), + // 弱依赖:Redis 仅作缓存时,启动不阻塞 + weakDependent: true, + }, + }; + + // ==================== JWT(扫描器长期令牌) ==================== + // 扫描器注册/登录时下发长期 JWT,后续调用本服务时带 Authorization: Bearer + config.jwt = { + // 签名密钥:生产环境必须用环境变量 JWT_SECRET 注入(未设置时下面直接抛错) + secret: env.JWT_SECRET || 'pack-service-dev-secret-please-change', + issuer: 'pack-service', + audience: 'scanner', + // 扫描器令牌有效期(长期),支持 '365d' / '10y' / 秒数 + scannerExpiresIn: env.SCANNER_JWT_EXPIRES || '365d', + // 设备扫码登录(GET /api/device/login)下发令牌的**默认时长,同时也是上限**: + // 设备可以用 ?expiresIn=30d 申请更短的,但不能比它长(要整体放宽就改这个) + deviceExpiresIn: env.DEVICE_JWT_EXPIRES || env.SCANNER_JWT_EXPIRES || '365d', + // 用户令牌有效期(扫码登录 / 前端接口用的 JWT) + userExpiresIn: env.USER_JWT_EXPIRES || '7d', + }; + + if (!env.JWT_SECRET && appInfo.env === 'prod') { + throw new Error('[config] 生产环境必须通过环境变量 JWT_SECRET 指定 JWT 签名密钥'); + } + + // ==================== 业务配置 ==================== + config.cache = { + // 缓存 key 前缀,多项目共用一个 Redis 时用来隔离 + prefix: env.CACHE_PREFIX || 'packs:', + // 默认过期时间(秒) + ttl: Number(env.CACHE_TTL || 300), + }; + + // 登录页的自助注册(生产环境建议关掉:REGISTER_ENABLED=false,改用 npm run user:pass 建号) + config.register = { + enable: !/^(0|false|no|off)$/i.test(String(env.REGISTER_ENABLED || 'true')), + }; + + // ==================== 邮件 / 邮箱验证码(注册时需要验证邮箱) ==================== + config.email = { + // 未配置 SMTP_HOST 时走开发模式:验证码写日志并在注册页回显(仅本地/测试用) + devMode: !env.SMTP_HOST, + // 发件人显示名用站点名(邮箱域名保持 pack-service.local,技术标识不动) + from: env.SMTP_FROM || `${config.siteName} `, + smtp: { + host: env.SMTP_HOST || null, + port: Number(env.SMTP_PORT || 465), + secure: String(env.SMTP_SECURE || 'true') !== 'false', + user: env.SMTP_USER || null, + password: env.SMTP_PASSWORD || null, + }, + // 验证码有效期(秒)/ 重发间隔(秒)/ 同一个验证码最多试几次 + codeTtl: Number(env.EMAIL_CODE_TTL || 600), + resendInterval: Number(env.EMAIL_CODE_RESEND || 60), + maxAttempts: Number(env.EMAIL_CODE_ATTEMPTS || 5), + // 重置密码链接有效期(秒,默认 30 分钟) + resetTtl: Number(env.EMAIL_RESET_TTL || 1800), + // 邮件里链接用的站点地址(不配就用请求里的 host) + siteUrl: env.SITE_URL || '', + }; + + // ==================== 微信扫码登录(登录页右上角三角形切换) ==================== + config.wechat = { + // 微信开放平台「网站应用」的 appid / secret;不配则二维码退化为本地演示码 + appid: env.WECHAT_APPID || '', + secret: env.WECHAT_SECRET || '', + // 扫码回调地址(不配就按当前请求的 origin 自动拼 /login/wechat/callback) + redirectUri: env.WECHAT_REDIRECT_URI || '', + // 微信接口地址(默认官方;自建网关/联调时可改,如 http://127.0.0.1:7099) + apiBase: env.WECHAT_API_BASE || 'https://api.weixin.qq.com', + // 扫码串码:长度、二维码内容里的 spm 格式(`{code}` 占位) + codeLength: Number(env.WECHAT_CODE_LENGTH || 6), + spmPattern: env.WECHAT_SPM_PATTERN || '1.0.{code}.1', + // 二维码(本地生成 SVG,不引用任何第三方图片):单元格像素、静默区格数(QR 规范建议 ≥ 4) + qrCellSize: Number(env.WECHAT_QR_CELL || 6), + qrMargin: Number(env.WECHAT_QR_MARGIN || 4), + // 扫码状态(二维码)有效期(秒) + stateTtl: Number(env.WECHAT_STATE_TTL || 600), + // 长轮询最长挂起秒数(默认 60s;前端建议再留一点自己的超时,比如 +10s) + pollWait: Number(env.WECHAT_POLL_WAIT || 60), + }; + + // 日志(生产建议按需调整) + config.logger = { + consoleLevel: 'INFO', + }; + + // 多实例并存时用 LOG_DIR 把日志分到不同目录,免得到处翻同一个日志文件 + // 例(PowerShell):$env:LOG_DIR='logs-test'; npm run dev:test + // ⚠️ 必须写在上面 config.logger 赋值之后,否则会被整个覆盖掉 + if (env.LOG_DIR) { + config.logger.dir = path.resolve(appInfo.baseDir, env.LOG_DIR); + } + + return config; +}; diff --git a/backend/config/config.unittest.js b/backend/config/config.unittest.js new file mode 100644 index 0000000..9a3725f --- /dev/null +++ b/backend/config/config.unittest.js @@ -0,0 +1,13 @@ +'use strict'; + +/** + * 单测专用配置 + * + * 只给内部接口放一个固定的运维令牌(`X-Internal-Token`),省得每个用例都去签 JWT; + * 真实环境请用环境变量 `INTERNAL_TOKEN` 注入,**不要用这个值**。 + */ +module.exports = { + internal: { + token: 'test-internal-token', + }, +}; diff --git a/backend/config/plugin.js b/backend/config/plugin.js new file mode 100644 index 0000000..076e42a --- /dev/null +++ b/backend/config/plugin.js @@ -0,0 +1,15 @@ +'use strict'; + +/** 插件开关 */ +module.exports = { + // MySQL(通过 Sequelize ORM 访问) + sequelize: { + enable: true, + package: 'egg-sequelize', + }, + // Redis(缓存 / 登录码 / 长轮询发布订阅) + redis: { + enable: true, + package: 'egg-redis', + }, +}; diff --git a/backend/config/plugin.unittest.js b/backend/config/plugin.unittest.js new file mode 100644 index 0000000..c08a2f6 --- /dev/null +++ b/backend/config/plugin.unittest.js @@ -0,0 +1,19 @@ +'use strict'; + +/** + * 单元测试环境不加载数据库插件: + * - sequelize 插件启用时会在 beforeStart 里 authenticate(),本机没起 MySQL 会导致启动失败 + * - redis 插件同理 + * + * 测试里用 mock(app, 'model', fakeModel) / mock(app, 'redis', fakeRedis) 注入假实现, + * 所以 npm test 不需要本机启动 MySQL / Redis。 + * 需要连真实数据库的集成测试时,复制一个 config/plugin.integration.js 把插件打开即可。 + */ +module.exports = { + sequelize: { + enable: false, + }, + redis: { + enable: false, + }, +}; diff --git a/backend/jsconfig.json b/backend/jsconfig.json new file mode 100644 index 0000000..1bbed3f --- /dev/null +++ b/backend/jsconfig.json @@ -0,0 +1,5 @@ +{ + "include": [ + "**/*" + ] +} \ No newline at end of file diff --git a/backend/package-lock.json b/backend/package-lock.json new file mode 100644 index 0000000..74a59dc --- /dev/null +++ b/backend/package-lock.json @@ -0,0 +1,10162 @@ +{ + "name": "pack-service", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "pack-service", + "version": "1.0.0", + "dependencies": { + "bcryptjs": "^3.0.3", + "egg": "^3.34.0", + "egg-redis": "^2.6.1", + "egg-scripts": "^3.1.0", + "egg-sequelize": "^6.0.0", + "http-proxy": "^1.18.1", + "jsonwebtoken": "^9.0.3", + "koa-static": "^5.0.0", + "mysql2": "^3.24.6", + "nodemailer": "^10.1.2", + "qrcode-generator": "^2.0.4", + "sequelize": "^6.37.8" + }, + "devDependencies": { + "egg-bin": "^6.13.0", + "egg-mock": "^5.15.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@artus-cli/artus-cli": { + "version": "0.2.10", + "resolved": "https://registry.npmjs.org/@artus-cli/artus-cli/-/artus-cli-0.2.10.tgz", + "integrity": "sha512-DmNKs8JwOtQTIqnLxGbLMy7cur1OUzcEvPIYNdBZpF9dFib7sYJt2+c4cnNVH9j8VeGAHIwWFPX2MQhFpUjIKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@artus-cli/plugin-help": "^1.0.0", + "@artus-cli/plugin-version": "^1.0.0", + "@artus/core": "^1.0.0", + "@artus/injection": "^0.5.1", + "@artus/pipeline": "^0.2.2", + "command-line-usage": "^6.1.3", + "koa-compose": "^4.1.0", + "lodash": "^4.17.21", + "pkg-up": "^3.1.0", + "reflect-metadata": "^0.1.13", + "tslib": "^2.4.0", + "type-fest": "^3.4.0", + "yargs-parser": "^21.1.1" + } + }, + "node_modules/@artus-cli/plugin-autocomplete": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@artus-cli/plugin-autocomplete/-/plugin-autocomplete-0.1.1.tgz", + "integrity": "sha512-7xlYTRpD39HyAPMJ+NgIan8TsgvScuOWkAZP3pbmg2vzIi4QdEqpXoLRf86GwG3IUiUFQ2XIiCEcUz7Vb3Qejg==", + "dev": true, + "license": "MIT", + "dependencies": { + "inquirer": "^8.2.5", + "tslib": "^2.4.0", + "yargs-parser": "^21.1.1" + } + }, + "node_modules/@artus-cli/plugin-help": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@artus-cli/plugin-help/-/plugin-help-1.1.0.tgz", + "integrity": "sha512-N4r6yIag06fwq41ROeIe6Gy7Oq5ShdbwShUQhET/XFT/e505mf+GUb65R6jWGbofp2+8gAGh98YgBNqa7+cUwg==", + "dev": true, + "license": "MIT", + "dependencies": { + "command-line-usage": "^6.1.3", + "tslib": "^2.4.0" + } + }, + "node_modules/@artus-cli/plugin-version": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@artus-cli/plugin-version/-/plugin-version-1.0.2.tgz", + "integrity": "sha512-gD/nJAoYdF6XAho0fcMlbwiekmAsunwqq4R7BHKaq3f+qOWVFHqoAFWa05evxx+TUQHd3+18RrwxqJN6LydVhg==", + "dev": true, + "license": "MIT", + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@artus/core": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@artus/core/-/core-1.0.9.tgz", + "integrity": "sha512-6/jaSThVFhV9jLR98aJ4u4JSB3ObQ2wt54XGn4YfJsYt2OpPw2rD6/vQFeZtRoZ9CpTiLeKgNuz6Fe4EzYXbsQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@artus/injection": "^0.5.1", + "@artus/pipeline": "^0.2.2", + "deepmerge": "^4.2.2", + "minimatch": "^5.0.1" + }, + "peerDependencies": { + "reflect-metadata": "^0.1.13" + } + }, + "node_modules/@artus/injection": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/@artus/injection/-/injection-0.5.3.tgz", + "integrity": "sha512-0/F6EWZhT4Ki5Y5ugIDEehPMj6NFguG5lD6Q0UynaLN76A7Hbs7Ooiu2VWioouzodx6vCW3bthZ7V6vj+5Daog==", + "dev": true, + "license": "ISC", + "dependencies": { + "tslib": "^2.6.2" + } + }, + "node_modules/@artus/pipeline": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@artus/pipeline/-/pipeline-0.2.3.tgz", + "integrity": "sha512-W4gBvkjD5bh7DScWn5DIdg3mRi93kabYCsOPTVN1sjtYVHlLX3xikyscdFphTjYlrmO4G+tP2lPH4pfBm3Sepg==", + "dev": true, + "license": "MIT", + "dependencies": { + "tslib": "^2.3.1" + } + }, + "node_modules/@bcoe/v8-coverage": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-1.0.2.tgz", + "integrity": "sha512-6zABk/ECA/QYSCQ1NGiVwwbQerUCZ+TQbp64Q3AgmfNvurHH0j8TtXa1qbShXA6qqkpAj4V5W8pP6mLe1mcMqA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@eggjs/ip": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@eggjs/ip/-/ip-2.1.0.tgz", + "integrity": "sha512-jOsufOpySKBld+N1GG8IAW9EEQNmQ6bDaBnrRlYFk6AspoxG8gAzXSW93ZFfEPwscS5rL7UbDUKyIHUkmkTPyw==", + "license": "MIT", + "engines": { + "node": ">= 14.0.0" + } + }, + "node_modules/@eggjs/router": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@eggjs/router/-/router-2.2.0.tgz", + "integrity": "sha512-EKnOrZ/pHMFQ1gAj3z0Yn1UnGYH/wSsc2jk06H6RrZp6ty9H6RWyP782e7FT8WL3pAevRY+SAQoH7aPh1SDSVA==", + "license": "MIT", + "dependencies": { + "co": "^4.6.0", + "http-errors": "^1.3.1", + "inflection": "^1.12.0", + "koa-compose": "^3.0.0", + "koa-convert": "^1.2.0", + "methods": "^1.0.1", + "path-to-regexp": "^1.9.0", + "urijs": "^1.19.0", + "utility": "^1.15.0" + }, + "engines": { + "node": ">= 8.5.0" + } + }, + "node_modules/@eggjs/router/node_modules/koa-compose": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/koa-compose/-/koa-compose-3.2.1.tgz", + "integrity": "sha512-8gen2cvKHIZ35eDEik5WOo8zbVp9t4cP8p4hW4uE55waxolLRexKKrqfCpwhGVppnB40jWeF8bZeTVg99eZgPw==", + "license": "MIT", + "dependencies": { + "any-promise": "^1.1.0" + } + }, + "node_modules/@eggjs/router/node_modules/utility": { + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/utility/-/utility-1.18.0.tgz", + "integrity": "sha512-PYxZDA+6QtvRvm//++aGdmKG/cI07jNwbROz0Ql+VzFV1+Z0Dy55NI4zZ7RHc9KKpBePNFwoErqIuqQv/cjiTA==", + "license": "MIT", + "dependencies": { + "copy-to": "^2.0.1", + "escape-html": "^1.0.3", + "mkdirp": "^0.5.1", + "mz": "^2.7.0", + "unescape": "^1.0.1" + }, + "engines": { + "node": ">= 0.12.0" + } + }, + "node_modules/@eggjs/utils": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/@eggjs/utils/-/utils-4.4.1.tgz", + "integrity": "sha512-/bu4ORRNSLSjrQQ4KDBgtyF92EmgmtdgjoXBIhBexxEqoV5Tg6kX4xdcG42cw+Cq3WBnUq/PzSthEPHbSlkQgg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@fastify/busboy": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.1.tgz", + "integrity": "sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==", + "license": "MIT", + "engines": { + "node": ">=14" + } + }, + "node_modules/@hapi/bourne": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@hapi/bourne/-/bourne-3.0.0.tgz", + "integrity": "sha512-Waj1cwPXJDucOib4a3bAISsKJVb15MKi9IvmTI/7ssVEm6sywXGjVJDhl6/umt1pK1ZS7PacXU3A1PmFKHEZ2w==", + "license": "BSD-3-Clause" + }, + "node_modules/@inquirer/external-editor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@inquirer/external-editor/-/external-editor-1.0.3.tgz", + "integrity": "sha512-RWbSrDiYmO4LbejWY7ttpxczuwQyZLBUyygsA9Nsv95hpzUWwnNTVQmAq3xuh7vNwCp07UTmE5i11XAEExx4RA==", + "dev": true, + "license": "MIT", + "dependencies": { + "chardet": "^2.1.1", + "iconv-lite": "^0.7.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@types/node": ">=18" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/@inquirer/external-editor/node_modules/iconv-lite": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.3.tgz", + "integrity": "sha512-IKXpvIzjnC9XTAUbVBcMfGS0EPaIXtW6v+zr+RRp+hqULEpo0owZax6wyRwPOJbWbzjYspQwusTsfVr0ifh4uQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/@ioredis/commands": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@ioredis/commands/-/commands-1.11.0.tgz", + "integrity": "sha512-tuMmOu6dtyGFv/fzCjtapCJj/zgoHaFsqs3wKsroJSRXtlLmyL/t+B7uaQiavGk1F3WWFQcUqZwk92bpp9jKcA==", + "license": "MIT" + }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-regex": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.4.0.tgz", + "integrity": "sha512-KzTVk2tCWAHtYrvvvaP8bJKJq2pVinhLcGEQdtLIYPbmNGNyYe8QwNaTUYQp2J7/vIsUKt5QCqAfUkYyG9DkOw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-styles": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@isaacs/cliui/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@isaacs/cliui/node_modules/strip-ansi": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz", + "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.2.2" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/@istanbuljs/schema": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.6.tgz", + "integrity": "sha512-+Sg6GCR/wy1oSmQDFq4LQDAhm3ETKnorxN+y5nbLULOR3P0c14f2Wurzj3/xqPXtasLFfHd5iRFQ7AJt4KH2cw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/schemas": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", + "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@sinclair/typebox": "^0.27.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/types": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", + "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/schemas": "^29.6.3", + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^17.0.8", + "chalk": "^4.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/types/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@jest/types/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@jest/types/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/@jest/types/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jest/types/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/types/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@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.npmjs.org/@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.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, + "node_modules/@noble/hashes": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.8.0.tgz", + "integrity": "sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.21.3 || >=16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "license": "MIT", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@paralleldrive/cuid2": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@paralleldrive/cuid2/-/cuid2-2.3.1.tgz", + "integrity": "sha512-XO7cAxhnTZl0Yggq6jOgjiOHhbgcO4NqFqwSmQpjK3b6TEE6Uj/jfSk6wzYyemh3+I0sHirKSetjQwn5cZktFw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@noble/hashes": "^1.1.5" + } + }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/@sinclair/typebox": { + "version": "0.27.12", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.12.tgz", + "integrity": "sha512-hhyNJ+nbR6ZR7pToHvllEFun9TL0sbL+tk/ON75lo+Xas054uez98qRbsuNt7MBCyZKK4+8Yli/OAGZhmfBZ/g==", + "dev": true, + "license": "MIT" + }, + "node_modules/@tsconfig/node10": { + "version": "1.0.13", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.13.tgz", + "integrity": "sha512-gcLdvR9HO1ZJBypsOGqaP6TFEzb6vIta0KSTLt9NAQ6pXQO3cRgSVyCN6pzYqI9DlJgY71XKO0dpDhCf08b3pg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@tsconfig/node12": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", + "dev": true, + "license": "MIT" + }, + "node_modules/@tsconfig/node14": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", + "dev": true, + "license": "MIT" + }, + "node_modules/@tsconfig/node16": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", + "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/accepts": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/@types/accepts/-/accepts-1.3.7.tgz", + "integrity": "sha512-Pay9fq2lM2wXPWbteBsRAGiWH2hig4ZE2asK+mm7kUzlxRTfL961rj89I6zV/E3PcIkDqyuBEcMxFT7rccugeQ==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/bluebird": { + "version": "3.5.42", + "resolved": "https://registry.npmjs.org/@types/bluebird/-/bluebird-3.5.42.tgz", + "integrity": "sha512-Jhy+MWRlro6UjVi578V/4ZGNfeCOcNCp0YaFNIUGFKlImowqwb1O/22wDVk3FDGMLqxdpOV3qQHD5fPEH4hK6A==", + "license": "MIT" + }, + "node_modules/@types/body-parser": { + "version": "1.19.6", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.6.tgz", + "integrity": "sha512-HLFeCYgz89uk22N5Qg3dvGvsv46B8GLvKKo1zKG4NybA8U2DiEO3w9lqGg29t/tfLRJpJ6iQxnVw4OnB7MoM9g==", + "license": "MIT", + "dependencies": { + "@types/connect": "*", + "@types/node": "*" + } + }, + "node_modules/@types/connect": { + "version": "3.4.38", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", + "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/content-disposition": { + "version": "0.5.9", + "resolved": "https://registry.npmjs.org/@types/content-disposition/-/content-disposition-0.5.9.tgz", + "integrity": "sha512-8uYXI3Gw35MhiVYhG3s295oihrxRyytcRHjSjqnqZVDDy/xcGBRny7+Xj1Wgfhv5QzRtN2hB2dVRBUX9XW3UcQ==", + "license": "MIT" + }, + "node_modules/@types/continuation-local-storage": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/@types/continuation-local-storage/-/continuation-local-storage-3.2.7.tgz", + "integrity": "sha512-Q7dPOymVpRG5Zpz90/o26+OAqOG2Sw+FED7uQmTrJNCF/JAPTylclZofMxZKd6W7g1BDPmT9/C/jX0ZcSNTQwQ==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/cookiejar": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@types/cookiejar/-/cookiejar-2.1.5.tgz", + "integrity": "sha512-he+DHOWReW0nghN24E1WUqM0efK4kI9oTqDm6XmK8ZPe2djZ90BSNdGnIyCLzCPw7/pogPlGbzI2wHGGmi4O/Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/cookies": { + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/@types/cookies/-/cookies-0.9.2.tgz", + "integrity": "sha512-1AvkDdZM2dbyFybL4fxpuNCaWyv//0AwsuUk2DWeXyM1/5ZKm6W3z6mQi24RZ4l2ucY+bkSHzbDVpySqPGuV8A==", + "license": "MIT", + "dependencies": { + "@types/connect": "*", + "@types/express": "*", + "@types/keygrip": "*", + "@types/node": "*" + } + }, + "node_modules/@types/debug": { + "version": "4.1.13", + "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.13.tgz", + "integrity": "sha512-KSVgmQmzMwPlmtljOomayoR89W4FynCAi3E8PPs7vmDVPe84hT+vGPKkJfThkmXs0x0jAaa9U8uW8bbfyS2fWw==", + "license": "MIT", + "dependencies": { + "@types/ms": "*" + } + }, + "node_modules/@types/depd": { + "version": "1.1.38", + "resolved": "https://registry.npmjs.org/@types/depd/-/depd-1.1.38.tgz", + "integrity": "sha512-CzBVWcYMVwSzZlXJ6/Eyy/9owI65qpgWMFEtCsdqEoTMzSsjIiHlIKPq0Pa1SpBxiApaKeBehL+6bChgsVtYuA==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/express": { + "version": "5.0.6", + "resolved": "https://registry.npmjs.org/@types/express/-/express-5.0.6.tgz", + "integrity": "sha512-sKYVuV7Sv9fbPIt/442koC7+IIwK5olP1KWeD88e/idgoJqDm3JV/YUiPwkoKK92ylff2MGxSz1CSjsXelx0YA==", + "license": "MIT", + "dependencies": { + "@types/body-parser": "*", + "@types/express-serve-static-core": "^5.0.0", + "@types/serve-static": "^2" + } + }, + "node_modules/@types/express-serve-static-core": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-5.1.3.tgz", + "integrity": "sha512-dPfW8NFiOF4wOHc7+N/QSxlY9cfSsenewGbAz8C8U/MULPd/YZ27LvJUIlzaXie7e6Ove9YunJGgC9tbHD2cKw==", + "license": "MIT", + "dependencies": { + "@types/node": "*", + "@types/qs": "*", + "@types/range-parser": "*", + "@types/send": "*" + } + }, + "node_modules/@types/http-assert": { + "version": "1.5.6", + "resolved": "https://registry.npmjs.org/@types/http-assert/-/http-assert-1.5.6.tgz", + "integrity": "sha512-TTEwmtjgVbYAzZYWyeHPrrtWnfVkm8tQkP8P21uQifPgMRgjrow3XDEYqucuC8SKZJT7pUnhU/JymvjggxO9vw==", + "license": "MIT" + }, + "node_modules/@types/http-errors": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.5.tgz", + "integrity": "sha512-r8Tayk8HJnX0FztbZN7oVqGccWgw98T/0neJphO91KkmOzug1KkofZURD4UaD5uH8AqcFLfdPErnBod0u71/qg==", + "license": "MIT" + }, + "node_modules/@types/ioredis": { + "version": "4.28.10", + "resolved": "https://registry.npmjs.org/@types/ioredis/-/ioredis-4.28.10.tgz", + "integrity": "sha512-69LyhUgrXdgcNDv7ogs1qXZomnfOEnSmrmMFqKgt1XMJxmoOSG/u3wYy13yACIfKuMJ8IhKgHafDO3sx19zVQQ==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/istanbul-lib-coverage": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", + "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/istanbul-lib-report": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz", + "integrity": "sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/istanbul-lib-coverage": "*" + } + }, + "node_modules/@types/istanbul-reports": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz", + "integrity": "sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/istanbul-lib-report": "*" + } + }, + "node_modules/@types/keygrip": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@types/keygrip/-/keygrip-1.0.6.tgz", + "integrity": "sha512-lZuNAY9xeJt7Bx4t4dx0rYCDqGPW8RXhQZK1td7d4H6E9zYbLoOtjBvfwdTKpsyxQI/2jv+armjX/RW+ZNpXOQ==", + "license": "MIT" + }, + "node_modules/@types/koa": { + "version": "2.15.2", + "resolved": "https://registry.npmjs.org/@types/koa/-/koa-2.15.2.tgz", + "integrity": "sha512-CB+iyjjh1uS5N6/CKwXvw0qA7USMS2WVc4Tjf660yCjhdvqzNr8gdFcIawB41zGGptOQ+d1fnpaQWIIUXYxR3w==", + "license": "MIT", + "dependencies": { + "@types/accepts": "*", + "@types/content-disposition": "*", + "@types/cookies": "*", + "@types/http-assert": "*", + "@types/http-errors": "*", + "@types/keygrip": "*", + "@types/koa-compose": "*", + "@types/node": "*" + } + }, + "node_modules/@types/koa-compose": { + "version": "3.2.9", + "resolved": "https://registry.npmjs.org/@types/koa-compose/-/koa-compose-3.2.9.tgz", + "integrity": "sha512-BroAZ9FTvPiCy0Pi8tjD1OfJ7bgU1gQf0eR6e1Vm+JJATy9eKOG3hQMFtMciMawiSOVnLMdmUOC46s7HBhSTsA==", + "license": "MIT", + "dependencies": { + "@types/koa": "*" + } + }, + "node_modules/@types/koa-router": { + "version": "7.4.9", + "resolved": "https://registry.npmjs.org/@types/koa-router/-/koa-router-7.4.9.tgz", + "integrity": "sha512-YibkqJrFWwwF55YtZo6dORpMj/1zfweHHIZA/qpA+2JPcVbBopAvLjejTcO1ojWAJfzf1tPC+CrPnLDuVRkUEA==", + "license": "MIT", + "dependencies": { + "@types/koa": "*" + } + }, + "node_modules/@types/lodash": { + "version": "4.17.26", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.26.tgz", + "integrity": "sha512-48NWfiY6oNcKOh47Z4h+sIvwcQR91h6KPhaYKgeMIrkT2jV82Gy90SErj60vW8jQbeMSOSbhIv3bZ7JoqPPVhA==", + "license": "MIT" + }, + "node_modules/@types/methods": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@types/methods/-/methods-1.1.4.tgz", + "integrity": "sha512-ymXWVrDiCxTBE3+RIrrP533E70eA+9qu7zdWoHuOmGujkYtzf4HQF96b8nwHLqhuf4ykX61IGRIB38CC6/sImQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/minimatch": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.5.tgz", + "integrity": "sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==", + "license": "MIT" + }, + "node_modules/@types/ms": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@types/ms/-/ms-2.1.0.tgz", + "integrity": "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==", + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "26.6.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-26.6.5.tgz", + "integrity": "sha512-uMzsv9stDdofIZBx4UGh4Z9ZgXnGC9seRDscilBcTHAeOFk67MZg/k9bWVfO+bk4qZmG+l52hRnLwUiH2LnJTg==", + "license": "MIT", + "dependencies": { + "undici-types": "~8.9.0" + } + }, + "node_modules/@types/qs": { + "version": "6.15.1", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.15.1.tgz", + "integrity": "sha512-GZHUBZR9hckSUhrxmp1nG6NwdpM9fCunJwyThLW1X3AyHgd9IlHb6VANpQQqDr2o/qQp6McZ3y/IA2rVzKzSbw==", + "license": "MIT" + }, + "node_modules/@types/range-parser": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", + "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==", + "license": "MIT" + }, + "node_modules/@types/send": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@types/send/-/send-1.2.1.tgz", + "integrity": "sha512-arsCikDvlU99zl1g69TcAB3mzZPpxgw0UQnaHeC1Nwb015xp8bknZv5rIfri9xTOcMuaVgvabfIRA7PSZVuZIQ==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/sequelize": { + "version": "4.28.20", + "resolved": "https://registry.npmjs.org/@types/sequelize/-/sequelize-4.28.20.tgz", + "integrity": "sha512-XaGOKRhdizC87hDgQ0u3btxzbejlF+t6Hhvkek1HyphqCI4y7zVBIVAGmuc4cWJqGpxusZ1RiBToHHnNK/Edlw==", + "license": "MIT", + "dependencies": { + "@types/bluebird": "*", + "@types/continuation-local-storage": "*", + "@types/lodash": "*", + "@types/validator": "*" + } + }, + "node_modules/@types/serve-static": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-2.2.0.tgz", + "integrity": "sha512-8mam4H1NHLtu7nmtalF7eyBH14QyOASmcxHhSfEoRyr0nP/YdoesEtU+uSRvMe96TW/HPTtkoKqQLl53N7UXMQ==", + "license": "MIT", + "dependencies": { + "@types/http-errors": "*", + "@types/node": "*" + } + }, + "node_modules/@types/superagent": { + "version": "8.1.11", + "resolved": "https://registry.npmjs.org/@types/superagent/-/superagent-8.1.11.tgz", + "integrity": "sha512-KA7srSW/HENDtOw9DOqaFLgWuMqN9WgjEw62lh9dpvRaZDkhdOkazASd7X7i2eMUYLHa1U37ZttnePsH5zTDHw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/cookiejar": "^2.1.5", + "@types/methods": "^1.1.4", + "@types/node": "*", + "form-data": "^4.0.0" + } + }, + "node_modules/@types/supertest": { + "version": "2.0.16", + "resolved": "https://registry.npmjs.org/@types/supertest/-/supertest-2.0.16.tgz", + "integrity": "sha512-6c2ogktZ06tr2ENoZivgm7YnprnhYE4ZoXGMY+oA7IuAf17M8FWvujXZGmxLv8y0PTyts4x5A+erSwVUFA8XSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/superagent": "*" + } + }, + "node_modules/@types/validator": { + "version": "13.15.10", + "resolved": "https://registry.npmjs.org/@types/validator/-/validator-13.15.10.tgz", + "integrity": "sha512-T8L6i7wCuyoK8A/ZeLYt1+q0ty3Zb9+qbSSvrIVitzT3YjZqkTZ40IbRsPanlB4h1QB3JVL1SYCdR6ngtFYcuA==", + "license": "MIT" + }, + "node_modules/@types/yargs": { + "version": "17.0.35", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.35.tgz", + "integrity": "sha512-qUHkeCyQFxMXg79wQfTtfndEC+N9ZZg76HJftDJp+qH2tV7Gj4OJi7l+PiWwJ+pWtW8GwSmqsDj/oymhrTWXjg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/yargs-parser": "*" + } + }, + "node_modules/@types/yargs-parser": { + "version": "21.0.3", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz", + "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@typescript/typescript-aix-ppc64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-aix-ppc64/-/typescript-aix-ppc64-7.0.2.tgz", + "integrity": "sha512-MTKKkWB7p/0E9xi1d1tHtZ5PiLkGEMIq88pK2CubZjOsLtYTLqhgIgi6zepFa+9GHZ6h05NMCkQxGKiPXMxXtQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "aix" + ], + "peer": true, + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-darwin-arm64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-darwin-arm64/-/typescript-darwin-arm64-7.0.2.tgz", + "integrity": "sha512-gowzar9MwS/aRWp6f3a4KUqzRjAZjOsmGNCM6LcTgXum+dBfgsBVMN+AgvOCCbguXyick6LJhpBszxMebJ8syA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "peer": true, + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-darwin-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-darwin-x64/-/typescript-darwin-x64-7.0.2.tgz", + "integrity": "sha512-SZ9xZInqApNlNGc9s0W1VSsktYSOe9cFqNOIqmN1Gs8SmkjKZYFt017G4VwPxASInODuAdbTW7sXiFUf893RgA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "peer": true, + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-freebsd-arm64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-freebsd-arm64/-/typescript-freebsd-arm64-7.0.2.tgz", + "integrity": "sha512-W5NH4y/J0plIIS5b2xvTEkU7JFxyqdMAOgf+Ilhl0vHQXKO5dZoxd+C/jEtq56c4F3wk71RB4BMRQ2XdI+bwYQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "freebsd" + ], + "peer": true, + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-freebsd-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-freebsd-x64/-/typescript-freebsd-x64-7.0.2.tgz", + "integrity": "sha512-UMGDx5sTpzNw3WiPebH7l90IWfJggEd+egHt/q6p7/Cm3zqoV7VxkGXt+3DxPIw8CcmvAB0j3sVVfbhX+M4Tpw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "freebsd" + ], + "peer": true, + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-linux-arm": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-arm/-/typescript-linux-arm-7.0.2.tgz", + "integrity": "sha512-gffT3xPz9sR7j/YJExkyPntrI0P2EP9XbOyWzth2/Gs0RstK+90RBcO0ncXoXy/beYll1SXw846Nf2zdnEz0QQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "peer": true, + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-linux-arm64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-arm64/-/typescript-linux-arm64-7.0.2.tgz", + "integrity": "sha512-Qh4eU4/y3yDjnfjjyPYihMj5/ODIlmt+Bzu17OI+fiSRDW57QmU5SiN63exPRNJPKUzcc1INa1NXdrJ+MqHjUQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "peer": true, + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-linux-loong64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-loong64/-/typescript-linux-loong64-7.0.2.tgz", + "integrity": "sha512-uEHck9i8hoAzXPiYRib1O7miOnz23SxIeVl6F4LXox+qov1K35jHcEW6VHKvZI+pyvl7fZEP4MCU5LYvIq1GuQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "peer": true, + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-linux-mips64el": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-mips64el/-/typescript-linux-mips64el-7.0.2.tgz", + "integrity": "sha512-R4KvAMnE43W5Qeqb0Ly56O3mWMWIAgsMyz36DCaycd5nbg/9kzm0liw3JocfRqyJY0KPmzFjbswozXyW0DnIYA==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "peer": true, + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-linux-ppc64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-ppc64/-/typescript-linux-ppc64-7.0.2.tgz", + "integrity": "sha512-DORx5b3sd/4S7eayxm4FQv+A7CrkUIGRaHiwI8oiHTAI1fAPWhF4J0vAlkC8biAlHSVVwxMQ3tjZ2/DVbnQiiA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "peer": true, + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-linux-riscv64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-riscv64/-/typescript-linux-riscv64-7.0.2.tgz", + "integrity": "sha512-wf0jqEDOjrPRnKwYRyyJDRo11KMbvMFrU+q4zqKyChODBzvlkbhNQfKvLxQCcwTpdDaXSHZTVuh0JoCrKCUMHQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "peer": true, + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-linux-s390x": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-s390x/-/typescript-linux-s390x-7.0.2.tgz", + "integrity": "sha512-IkwJc3L7yhytWd/ewjyxNDfOmswCm9GWMJT/ue/dU4aZNbwZeYAetq42VyLmsmSjvoX7z74X6ZaYCtzAr0EuGw==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "peer": true, + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-linux-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-x64/-/typescript-linux-x64-7.0.2.tgz", + "integrity": "sha512-EYdf2cNg7rgCWJnxCdJ+F3V39O8ihb37eHAu1LK8oAFizgTQbPOK7zHHXbPt8rX24COqODXeI3sIf0fCXG7H/A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "peer": true, + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-netbsd-arm64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-netbsd-arm64/-/typescript-netbsd-arm64-7.0.2.tgz", + "integrity": "sha512-+polYF4MF04aPpO5FTkHran9yUQDSXqy5GiSDKpsll5jy3l3+g9QLhpf39T+ePtefhXLOGrLl0QIjkQP6VnelA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "netbsd" + ], + "peer": true, + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-netbsd-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-netbsd-x64/-/typescript-netbsd-x64-7.0.2.tgz", + "integrity": "sha512-8YIT0EHM/3dq10ZOVF/A7pc/YSMtbcecct4rWtexrnSCHOPcpC2KTLXfTCR6vDpnSiY12heNb1GiN/wu+T/FyA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "netbsd" + ], + "peer": true, + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-openbsd-arm64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-openbsd-arm64/-/typescript-openbsd-arm64-7.0.2.tgz", + "integrity": "sha512-APT8+ClYnuYm1u9+kgGXoMj2VzWzcymwh2gNSQVySHfkRDGOTVkoWLjCmOQSaO+PoqQ57B0flRp9SA+7GnnkzQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "openbsd" + ], + "peer": true, + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-openbsd-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-openbsd-x64/-/typescript-openbsd-x64-7.0.2.tgz", + "integrity": "sha512-yX7s+Q0Dln0Dt9tEzZsAjXXR/+ytBM7AlglaqyeMPxQszJ1JhlJdZ6jLA+IzldHtflX81em7lDao1xXu+aRRkg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "openbsd" + ], + "peer": true, + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-sunos-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-sunos-x64/-/typescript-sunos-x64-7.0.2.tgz", + "integrity": "sha512-dLJDGaLZ1D4HPQn62u1n8mBDkJREwMsAkCdkwd4Ieqw+x3TUyTsqY0YiBCtE6H6OzzgGk3iuZ3vFWRS+E8/d1g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "sunos" + ], + "peer": true, + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-win32-arm64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-win32-arm64/-/typescript-win32-arm64-7.0.2.tgz", + "integrity": "sha512-Gyl1Vy6OsWesLzmq+EP0Fb7b4Nid5232AvcA2SFcdYreldpNtYFFofPjnt62y9hQy7VTaZp65ICJjuAQRaVcIQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "win32" + ], + "peer": true, + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/@typescript/typescript-win32-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-win32-x64/-/typescript-win32-x64-7.0.2.tgz", + "integrity": "sha512-0BQ3HkAHHlKLSp1qRvf3SUhGpGsDuhB/jgFw75guyqbxJqEaS0Cw/VFO8i2nHglJUzQCRtMMR/IBAKE3ETMC4g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "win32" + ], + "peer": true, + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "license": "MIT", + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/acorn": { + "version": "8.19.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.19.0.tgz", + "integrity": "sha512-oJlA3XiRm7Cyk6qFD2Jn8ak9B7jSy0qy00ADO3+8dpT0LSjFihQYv4C02LFCSYJV3Q37xYwwRy5m+IpIiUzqWw==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-walk": { + "version": "8.3.5", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.5.tgz", + "integrity": "sha512-HEHNfbars9v4pgpW6SO1KSPkfoS0xVOM/9UzkJltjlsHZmJasxg8aXkuZa7SMf8vKGIBhpUsPluQSqhJFCqebw==", + "dev": true, + "license": "MIT", + "dependencies": { + "acorn": "^8.11.0" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/address": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/address/-/address-2.0.3.tgz", + "integrity": "sha512-XNAb/a6TCqou+TufU8/u11HCu9x1gYvOoxLwtlXgIqmkrYQADVv6ljyW2zwiPhHz9R1gItAWpuDrdJMmrOBFEA==", + "license": "MIT", + "engines": { + "node": ">= 16.0.0" + } + }, + "node_modules/agentkeepalive": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.6.0.tgz", + "integrity": "sha512-kja8j7PjmncONqaTsB8fQ+wE2mSU2DJ9D4XKoJ5PFWIdRMa6SLSN1ff4mOr4jCbfRSsxR4keIiySJU0N9T5hIQ==", + "license": "MIT", + "dependencies": { + "humanize-ms": "^1.2.1" + }, + "engines": { + "node": ">= 8.0.0" + } + }, + "node_modules/ansi-colors": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", + "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "license": "MIT", + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-escapes/node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==", + "license": "MIT" + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "license": "ISC", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true, + "license": "MIT" + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, + "license": "Python-2.0" + }, + "node_modules/array-back": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-4.0.2.tgz", + "integrity": "sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/array-differ": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-3.0.0.tgz", + "integrity": "sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/arrify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", + "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/asap": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", + "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==", + "dev": true, + "license": "MIT" + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "license": "MIT" + }, + "node_modules/await-event": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/await-event/-/await-event-2.1.0.tgz", + "integrity": "sha512-hADm2dFnyugZnfFoJ0Oug2T9xAT2gFdvxZXXnWUOFsHL+VTCvj4Q7oBOinUYzvAFeAD5HN1YSrP78iS3/SQ7iQ==", + "license": "MIT" + }, + "node_modules/await-first": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/await-first/-/await-first-1.0.0.tgz", + "integrity": "sha512-SK20HicVu6lXvNM0nS1flurrs4/1NdhvccvEn52Gf+vpERZnnkKBnJvAQDsYkzJnsHs1bRNNKEiobEet7a/0TA==", + "license": "MIT", + "dependencies": { + "ee-first": "^1.1.1" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/aws-ssl-profiles": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/aws-ssl-profiles/-/aws-ssl-profiles-1.1.2.tgz", + "integrity": "sha512-NZKeq9AfyQvEeNlN0zSYAaWrmBffJh3IELMZfRpJVWgrpEbtEpnjvzqBPf+mxoI287JohRDoa+/nsfqqiZmF6g==", + "license": "MIT", + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "license": "MIT" + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/bcryptjs": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/bcryptjs/-/bcryptjs-3.0.3.tgz", + "integrity": "sha512-GlF5wPWnSa/X5LKM1o0wz0suXIINz1iHRLvTS+sLyi7XPbe5ycmYI3DlZqVGZZtDgl4DmasFg7gOB3JYbphV5g==", + "license": "BSD-3-Clause", + "bin": { + "bcrypt": "bin/bcrypt" + } + }, + "node_modules/binary-extensions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "node_modules/black-hole-stream": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/black-hole-stream/-/black-hole-stream-0.0.1.tgz", + "integrity": "sha512-FQSWhFQZmddoqWkwPMFeR5hJo9waZE796MuO7b0poStaPrm0Qr2em9FT4/TF1+0rOA1dRFabX+88rdX8YHxDTA==", + "license": "MIT" + }, + "node_modules/brace-expansion": { + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.7.tgz", + "integrity": "sha512-uZbew1NqdmPDTMJ8ah1y+b+9QEJrfkXFk3RcTQw3X0jW/xRUvFKsg1CfQdSYGdTbXZWExtU3J3ccxtnfw1Fi0g==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "license": "MIT", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true, + "license": "ISC" + }, + "node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "node_modules/buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==", + "license": "BSD-3-Clause" + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "license": "MIT" + }, + "node_modules/busboy": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", + "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==", + "dependencies": { + "streamsearch": "^1.1.0" + }, + "engines": { + "node": ">=10.16.0" + } + }, + "node_modules/byte": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/byte/-/byte-2.0.0.tgz", + "integrity": "sha512-rNiK8YxOMvquToaBubKxA10sjRIZ/taDqtc/1jLQA4X7aNDlA1XGx4Ciml3YxL8DskFz1XX3WFskSp0peKYSKg==", + "license": "MIT", + "dependencies": { + "debug": "^3.1.0", + "long": "^4.0.0", + "utility": "^1.13.1" + }, + "engines": { + "node": ">= 8.0.0" + } + }, + "node_modules/byte/node_modules/utility": { + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/utility/-/utility-1.18.0.tgz", + "integrity": "sha512-PYxZDA+6QtvRvm//++aGdmKG/cI07jNwbROz0Ql+VzFV1+Z0Dy55NI4zZ7RHc9KKpBePNFwoErqIuqQv/cjiTA==", + "license": "MIT", + "dependencies": { + "copy-to": "^2.0.1", + "escape-html": "^1.0.3", + "mkdirp": "^0.5.1", + "mz": "^2.7.0", + "unescape": "^1.0.1" + }, + "engines": { + "node": ">= 0.12.0" + } + }, + "node_modules/bytes": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-2.2.0.tgz", + "integrity": "sha512-zGRpnr2l5w/s8PxkrquUJoVeR06KvqPelrYqiSyQV7QEBqCYivpb6UzXYWC6JDBVtNFOT0rzJRFhkfJgxzmILA==", + "license": "MIT" + }, + "node_modules/c8": { + "version": "10.1.3", + "resolved": "https://registry.npmjs.org/c8/-/c8-10.1.3.tgz", + "integrity": "sha512-LvcyrOAaOnrrlMpW22n690PUvxiq4Uf9WMhQwNJ9vgagkL/ph1+D4uvjvDA5XCbykrc0sx+ay6pVi9YZ1GnhyA==", + "dev": true, + "license": "ISC", + "dependencies": { + "@bcoe/v8-coverage": "^1.0.1", + "@istanbuljs/schema": "^0.1.3", + "find-up": "^5.0.0", + "foreground-child": "^3.1.1", + "istanbul-lib-coverage": "^3.2.0", + "istanbul-lib-report": "^3.0.1", + "istanbul-reports": "^3.1.6", + "test-exclude": "^7.0.1", + "v8-to-istanbul": "^9.0.0", + "yargs": "^17.7.2", + "yargs-parser": "^21.1.1" + }, + "bin": { + "c8": "bin/c8.js" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "monocart-coverage-reports": "^2" + }, + "peerDependenciesMeta": { + "monocart-coverage-reports": { + "optional": true + } + } + }, + "node_modules/cache-content-type": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-content-type/-/cache-content-type-1.0.1.tgz", + "integrity": "sha512-IKufZ1o4Ut42YUrZSo8+qnMTrFuKkvyoLXUywKz9GJ5BrhOFGhLdkx9sG4KAnVvbY6kEcSFjLQul+DVmBm2bgA==", + "license": "MIT", + "dependencies": { + "mime-types": "^2.1.18", + "ylru": "^1.2.0" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/call-bind": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.9.tgz", + "integrity": "sha512-a/hy+pNsFUTR+Iz8TCJvXudKVLAnz/DyeSUo10I5yvFDQJBFU2s9uqQpoSrJlroHUKoKqzg+epxyP9lqFdzfBQ==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "get-intrinsic": "^1.3.0", + "set-function-length": "^1.2.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/camel-case": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-4.1.2.tgz", + "integrity": "sha512-gxGWBrTT1JuMx6R+o5PTXMmUnhnVzLQ9SNutD4YqKtI6ap897t3tKECYla6gCWEkplXnlNybEkZg9GEGxKFCgw==", + "license": "MIT", + "dependencies": { + "pascal-case": "^3.1.2", + "tslib": "^2.0.3" + } + }, + "node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/capital-case": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/capital-case/-/capital-case-1.0.4.tgz", + "integrity": "sha512-ds37W8CytHgwnhGGTi88pcPyR15qoNkOpYwmMMfnWqqWgESapLqvDx6huFjQ5vqWSn2Z06173XNA7LtMOeUh1A==", + "license": "MIT", + "dependencies": { + "no-case": "^3.0.4", + "tslib": "^2.0.3", + "upper-case-first": "^2.0.2" + } + }, + "node_modules/cfork": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/cfork/-/cfork-1.11.0.tgz", + "integrity": "sha512-pYyWhuXPq5OoaVPaQZXFf243oQ/+eCXu7ufOZxqi8HFI7TcTxbsi1/16CpT75dSuk78ErMJQlTkpzz9O82G/Ig==", + "license": "MIT", + "dependencies": { + "utility": "^1.12.0" + }, + "engines": { + "node": ">= 0.12.0" + } + }, + "node_modules/cfork/node_modules/utility": { + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/utility/-/utility-1.18.0.tgz", + "integrity": "sha512-PYxZDA+6QtvRvm//++aGdmKG/cI07jNwbROz0Ql+VzFV1+Z0Dy55NI4zZ7RHc9KKpBePNFwoErqIuqQv/cjiTA==", + "license": "MIT", + "dependencies": { + "copy-to": "^2.0.1", + "escape-html": "^1.0.3", + "mkdirp": "^0.5.1", + "mz": "^2.7.0", + "unescape": "^1.0.1" + }, + "engines": { + "node": ">= 0.12.0" + } + }, + "node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/chan": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/chan/-/chan-0.6.1.tgz", + "integrity": "sha512-/TdBP2UhbBmw7qnqkzo9Mk4rzvwRv4dlNPXFerqWy90T8oBspKagJNZxrDbExKHhx9uXXHjo3f9mHgs9iKO3nQ==", + "license": "MIT" + }, + "node_modules/change-case": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/change-case/-/change-case-4.1.2.tgz", + "integrity": "sha512-bSxY2ws9OtviILG1EiY5K7NNxkqg/JnRnFxLtKQ96JaviiIxi7djMrSd0ECT9AC+lttClmYwKw53BWpOMblo7A==", + "license": "MIT", + "dependencies": { + "camel-case": "^4.1.2", + "capital-case": "^1.0.4", + "constant-case": "^3.0.4", + "dot-case": "^3.0.4", + "header-case": "^2.0.4", + "no-case": "^3.0.4", + "param-case": "^3.0.4", + "pascal-case": "^3.1.2", + "path-case": "^3.0.4", + "sentence-case": "^3.0.4", + "snake-case": "^3.0.4", + "tslib": "^2.0.3" + } + }, + "node_modules/chardet": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-2.2.0.tgz", + "integrity": "sha512-rddelWYNPRrXq6PtNEN2S3f6t9ILzvqaN5pVgi4kqt9jHQaXIial9PznB5iSPVlQSLNaaH22ItWz3EJtQ10+OA==", + "dev": true, + "license": "MIT" + }, + "node_modules/chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/ci-info": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", + "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/circular-json-for-egg": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/circular-json-for-egg/-/circular-json-for-egg-1.0.0.tgz", + "integrity": "sha512-BzMR1dg0+YqcFoMETHq0gFeQNNKliXI1Oe+C0nx/4npLaohsR7/Oj3UFht65MLwF7zs6x13gOr+f4+JeYni6vw==", + "license": "MIT" + }, + "node_modules/cli-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", + "dev": true, + "license": "MIT", + "dependencies": { + "restore-cursor": "^3.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cli-spinners": { + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz", + "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-width": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz", + "integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">= 10" + } + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/cliui/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/cliui/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/cliui/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/cliui/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/clone": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8" + } + }, + "node_modules/cluster-client": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/cluster-client/-/cluster-client-3.7.0.tgz", + "integrity": "sha512-n0pLGPWlAjaGDJrLKTenjF1qoHbDjuYFlvX4UBoWCt9NjUTZGQhfNafF6Gw4Rj7oJqqdBGrdiIdHSvtOMQX5AA==", + "license": "MIT", + "dependencies": { + "byte": "^2.0.0", + "co": "^4.6.0", + "egg-logger": "^3.5.0", + "is-type-of": "^1.4.0", + "json-stringify-safe": "^5.0.1", + "long": "^4.0.0", + "sdk-base": "^4.2.1", + "serialize-json": "^1.0.3", + "tcp-base": "^3.2.0", + "utility": "^2.1.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/cluster-client/node_modules/is-type-of": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/is-type-of/-/is-type-of-1.4.0.tgz", + "integrity": "sha512-EddYllaovi5ysMLMEN7yzHEKh8A850cZ7pykrY1aNRQGn/CDjRDE9qEWbIdt7xGEVJmjBXzU/fNnC4ABTm8tEQ==", + "license": "MIT", + "dependencies": { + "core-util-is": "^1.0.2", + "is-class-hotfix": "~0.0.6", + "isstream": "~0.1.2" + } + }, + "node_modules/cluster-key-slot": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/cluster-key-slot/-/cluster-key-slot-1.1.2.tgz", + "integrity": "sha512-RMr0FhtfXemyinomL4hrWcYJxmX6deFdCxpJzhDttxgO1+bcCnkk+9drydLVDmAMG7NE6aN/fl4F7ucU/90gAA==", + "license": "Apache-2.0", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/cluster-reload": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/cluster-reload/-/cluster-reload-1.1.0.tgz", + "integrity": "sha512-lY3n9ohbJvDsDoaGGx/ER6eqaDKgVVmYjgoSL+XPxI0NHhkr4Ag60RSqVD1B9yZJz/q3FjB94bLfnuGuFuh7aw==", + "license": "MIT", + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", + "license": "MIT", + "engines": { + "iojs": ">= 1.0.0", + "node": ">= 0.12.0" + } + }, + "node_modules/co-body": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/co-body/-/co-body-6.2.0.tgz", + "integrity": "sha512-Kbpv2Yd1NdL1V/V4cwLVxraHDV6K8ayohr2rmH0J87Er8+zJjcTa6dAn9QMPC9CRgU8+aNajKbSf1TzDB1yKPA==", + "license": "MIT", + "dependencies": { + "@hapi/bourne": "^3.0.0", + "inflation": "^2.0.0", + "qs": "^6.5.2", + "raw-body": "^2.3.3", + "type-is": "^1.6.16" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/co-busboy": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/co-busboy/-/co-busboy-2.0.2.tgz", + "integrity": "sha512-xntc6PdplMQ9M92T5aKWRu8OBh4CbQcLHPnf2K3c+rD2xhAJcIjC5liblUquxDGTErsnHadMOsCcd6xhnpPAFA==", + "license": "MIT", + "dependencies": { + "black-hole-stream": "~0.0.1", + "busboy": "^1.6.0", + "chan": "^0.6.1", + "inflation": "^2.0.0" + }, + "engines": { + "node": ">= 14.0.0" + } + }, + "node_modules/coffee": { + "version": "5.5.1", + "resolved": "https://registry.npmjs.org/coffee/-/coffee-5.5.1.tgz", + "integrity": "sha512-ZKt9b/Iq0jhe7tYpDMXJggx8l/+YIcQFi2C+LvJRQ7lUSJnzayir1BGbsoHELKKyV+zevWMCsfmGAI1fREyRbw==", + "dev": true, + "license": "MIT", + "dependencies": { + "cross-spawn": "^6.0.5", + "debug": "^4.1.0", + "is-type-of": "^1.2.1" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/coffee/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/coffee/node_modules/is-type-of": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/is-type-of/-/is-type-of-1.4.0.tgz", + "integrity": "sha512-EddYllaovi5ysMLMEN7yzHEKh8A850cZ7pykrY1aNRQGn/CDjRDE9qEWbIdt7xGEVJmjBXzU/fNnC4ABTm8tEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "core-util-is": "^1.0.2", + "is-class-hotfix": "~0.0.6", + "isstream": "~0.1.2" + } + }, + "node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true, + "license": "MIT" + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/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/command-line-usage": { + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/command-line-usage/-/command-line-usage-6.1.3.tgz", + "integrity": "sha512-sH5ZSPr+7UStsloltmDh7Ce5fb8XPlHyoPzTpyyMuYCtervL65+ubVZ6Q61cFtFl62UyJlc8/JwERRbAFPUqgw==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-back": "^4.0.2", + "chalk": "^2.4.2", + "table-layout": "^1.0.2", + "typical": "^5.2.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "license": "MIT" + }, + "node_modules/common-bin": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/common-bin/-/common-bin-3.0.1.tgz", + "integrity": "sha512-AFGH8ZI3e82QiVZkLDCPCFOnBsdvs/FhY+ueDOFuSr+EqMGzPnneB6DkQSWqy7PC6kbkasfX2VQR5RKRR205lw==", + "license": "MIT", + "dependencies": { + "chalk": "^4.1.2", + "change-case": "^4.1.2", + "dargs": "^7.0.0", + "debug": "^4.3.4", + "is-type-of": "^1.2.1", + "semver": "^7.3.7", + "yargs": "^13.3.0", + "yargs-parser": "^13.1.2" + }, + "engines": { + "node": ">= 14.0.0" + } + }, + "node_modules/common-bin/node_modules/ansi-regex": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", + "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/common-bin/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/common-bin/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/common-bin/node_modules/cliui": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "license": "ISC", + "dependencies": { + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" + } + }, + "node_modules/common-bin/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/common-bin/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "license": "MIT" + }, + "node_modules/common-bin/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/common-bin/node_modules/decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/common-bin/node_modules/emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "license": "MIT" + }, + "node_modules/common-bin/node_modules/find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "license": "MIT", + "dependencies": { + "locate-path": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/common-bin/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/common-bin/node_modules/is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/common-bin/node_modules/is-type-of": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/is-type-of/-/is-type-of-1.4.0.tgz", + "integrity": "sha512-EddYllaovi5ysMLMEN7yzHEKh8A850cZ7pykrY1aNRQGn/CDjRDE9qEWbIdt7xGEVJmjBXzU/fNnC4ABTm8tEQ==", + "license": "MIT", + "dependencies": { + "core-util-is": "^1.0.2", + "is-class-hotfix": "~0.0.6", + "isstream": "~0.1.2" + } + }, + "node_modules/common-bin/node_modules/locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "license": "MIT", + "dependencies": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/common-bin/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "license": "MIT", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/common-bin/node_modules/p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "license": "MIT", + "dependencies": { + "p-limit": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/common-bin/node_modules/path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/common-bin/node_modules/semver": { + "version": "7.8.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", + "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/common-bin/node_modules/string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/common-bin/node_modules/strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^4.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/common-bin/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/common-bin/node_modules/wrap-ansi": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/common-bin/node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "license": "MIT", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/common-bin/node_modules/wrap-ansi/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "license": "MIT", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/common-bin/node_modules/wrap-ansi/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "license": "MIT" + }, + "node_modules/common-bin/node_modules/y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", + "license": "ISC" + }, + "node_modules/common-bin/node_modules/yargs": { + "version": "13.3.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", + "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", + "license": "MIT", + "dependencies": { + "cliui": "^5.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^13.1.2" + } + }, + "node_modules/common-bin/node_modules/yargs-parser": { + "version": "13.1.2", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", + "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", + "license": "ISC", + "dependencies": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + }, + "node_modules/component-emitter": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.1.tgz", + "integrity": "sha512-T0+barUSQRTUQASh8bx02dl+DhF54GtIDY13Y3m9oWTklKbb3Wv974meRpeZ3lp1JpLVECWWNHC4vaG2XHXouQ==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/compressible": { + "version": "2.0.18", + "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz", + "integrity": "sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg==", + "license": "MIT", + "dependencies": { + "mime-db": ">= 1.43.0 < 2" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "license": "MIT" + }, + "node_modules/constant-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/constant-case/-/constant-case-3.0.4.tgz", + "integrity": "sha512-I2hSBi7Vvs7BEuJDr5dDHfzb/Ruj3FyvFyh7KLilAjNQw3Be+xgqUBA2W6scVEcL0hL1dwPRtIqEPVUCKkSsyQ==", + "license": "MIT", + "dependencies": { + "no-case": "^3.0.4", + "tslib": "^2.0.3", + "upper-case": "^2.0.2" + } + }, + "node_modules/content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "license": "MIT", + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true, + "license": "MIT" + }, + "node_modules/cookie": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", + "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookiejar": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.4.tgz", + "integrity": "sha512-LDx6oHrK+PhzLKJU9j5S7/Y3jM/mUHvD/DeI1WQmJn652iPC5Y4TBzC9l+5OMOXlyTTA+SmVUPm0HQUwpD5Jqw==", + "dev": true, + "license": "MIT" + }, + "node_modules/cookies": { + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/cookies/-/cookies-0.9.2.tgz", + "integrity": "sha512-8BIbcC6tPZMv2/PD4PrB3CtKks7LmAWhA7FRZK/6/b/WJ2RUz00KCga7gq50S4/RhZ22kxefRFGgsuts0v3eoA==", + "license": "MIT", + "dependencies": { + "depd": "~2.0.0", + "keygrip": "~1.1.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/copy-to": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/copy-to/-/copy-to-2.0.1.tgz", + "integrity": "sha512-3DdaFaU/Zf1AnpLiFDeNCD4TOWe3Zl2RZaTzUvWiIk5ERzcCodOE20Vqq4fzCbNoHURFHT4/us/Lfq+S2zyY4w==", + "license": "MIT" + }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "license": "MIT" + }, + "node_modules/crc": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/crc/-/crc-3.8.0.tgz", + "integrity": "sha512-iX3mfgcTMIq3ZKLIsVFAbv7+Mc10kxabAGQb8HvjA1o3T1PIYprbakQ65d3I+2HGHt6nSKkM9PYjgoJO2KcFBQ==", + "license": "MIT", + "dependencies": { + "buffer": "^5.1.0" + } + }, + "node_modules/create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/cron-parser": { + "version": "2.18.0", + "resolved": "https://registry.npmjs.org/cron-parser/-/cron-parser-2.18.0.tgz", + "integrity": "sha512-s4odpheTyydAbTBQepsqd2rNWGa2iV3cyo8g7zbI2QQYGLVsfbhmwukayS1XHppe02Oy1fg7mg6xoaraVJeEcg==", + "license": "MIT", + "dependencies": { + "is-nan": "^1.3.0", + "moment-timezone": "^0.5.31" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/cross-spawn": { + "version": "6.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.6.tgz", + "integrity": "sha512-VqCUuhcd1iB+dsv8gxPttb5iZh/D0iubSP21g36KXdEuf6I5JiioesUVjpCdHV9MZRUfVFlvwtIUyPfxo5trtw==", + "dev": true, + "license": "MIT", + "dependencies": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + }, + "engines": { + "node": ">=4.8" + } + }, + "node_modules/csrf": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/csrf/-/csrf-3.1.0.tgz", + "integrity": "sha512-uTqEnCvWRk042asU6JtapDTcJeeailFy4ydOQS28bj1hcLnYRiqi8SsD2jS412AY1I/4qdOwWZun774iqywf9w==", + "license": "MIT", + "dependencies": { + "rndm": "1.2.0", + "tsscmp": "1.0.6", + "uid-safe": "2.1.5" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/cssfilter": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/cssfilter/-/cssfilter-0.0.10.tgz", + "integrity": "sha512-FAaLDaplstoRsDR8XGYH51znUN0UY7nMc6Z9/fvE8EXGwvJE9hu7W2vHwx1+bd6gCYnln9nLbzxFTrcO9YQDZw==", + "license": "MIT" + }, + "node_modules/dargs": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/dargs/-/dargs-7.0.0.tgz", + "integrity": "sha512-2iy1EkLdlBzQGvbweYRFxmFath8+K7+AKB0TlhHWkNuH+TmovaMH/Wp7V7R4u7f4SnX3OgLsU9t1NI9ioDnUpg==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/dateformat": { + "version": "4.6.3", + "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-4.6.3.tgz", + "integrity": "sha512-2P0p0pFGzHS5EMnhdxQi7aJN+iMheud0UhG4dlE1DLAlvL8JHjJJTX/CSm4JXwV0Ka5nGk3zC5mcb5bUQUxxMA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/dayjs": { + "version": "1.11.23", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.23.tgz", + "integrity": "sha512-QDTCU0M0MxR3hQfnlDJfwekQiaanm1ubOD231u73WBckQ/fsamwRLiE2GBz6D3a/xF1NgfiDLJjXBa1hYOYTtQ==", + "license": "MIT" + }, + "node_modules/debounce": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/debounce/-/debounce-1.2.1.tgz", + "integrity": "sha512-XRRe6Glud4rd/ZGQfiV1ruXSfbvfJedlV9Y6zOlP+2K04vBYiJEte6stfFkCP03aMnY5tsipamumUjL14fofug==", + "license": "MIT" + }, + "node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/decamelize": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", + "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/deep-equal": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", + "integrity": "sha512-bHtC0iYvWhyaTzvV3CZgPeZQqCOBGyGsVV7v4eevpdkLHfiSrXUdBG+qAuSz4RI70sszvjQ1QSZ98An1yNwpSw==", + "license": "MIT" + }, + "node_modules/deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/deepmerge": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/default-user-agent": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/default-user-agent/-/default-user-agent-1.0.0.tgz", + "integrity": "sha512-bDF7bg6OSNcSwFWPu4zYKpVkJZQYVrAANMYB8bc9Szem1D0yKdm4sa/rOCs2aC9+2GMqQ7KnwtZRvDhmLF0dXw==", + "license": "MIT", + "dependencies": { + "os-name": "~1.0.3" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/defaults": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz", + "integrity": "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "clone": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/define-properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", + "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "license": "MIT", + "dependencies": { + "define-data-property": "^1.0.1", + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==", + "license": "MIT" + }, + "node_modules/denque": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/denque/-/denque-1.5.1.tgz", + "integrity": "sha512-XwE+iZ4D6ZUB7mfYRMb5wByE8L74HCn30FBN7sWnXksWc1LO1bPDl67pBR9o/kC4z/xSNAwkMYcGgqDV3BE3Hw==", + "license": "Apache-2.0", + "engines": { + "node": ">=0.10" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "license": "MIT", + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/detect-port": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/detect-port/-/detect-port-2.1.0.tgz", + "integrity": "sha512-epZuWb/6Q62L+nDHJc/hQAqf8pylsqgk3BpZXVBx1CDnr3nkrVNn73Uu1rXcFzkNcc+hkP3whuOg7JZYaQB65Q==", + "license": "MIT", + "dependencies": { + "address": "^2.0.1" + }, + "bin": { + "detect": "dist/commonjs/bin/detect-port.js", + "detect-port": "dist/commonjs/bin/detect-port.js" + }, + "engines": { + "node": ">= 16.0.0" + } + }, + "node_modules/dezalgo": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/dezalgo/-/dezalgo-1.0.4.tgz", + "integrity": "sha512-rXSP0bf+5n0Qonsb+SVVfNfIsimO4HEtmnIpPHY8Q1UCzKlQrDMfdobr8nJOOsRgWCyMRqeSBQzmWUMq7zvVig==", + "dev": true, + "license": "ISC", + "dependencies": { + "asap": "^2.0.0", + "wrappy": "1" + } + }, + "node_modules/diff": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.2.tgz", + "integrity": "sha512-vtcDfH3TOjP8UekytvnHH1o1P4FcUdt4eQ1Y+Abap1tk/OB2MWQvcwS2ClCd1zuIhc3JKOx6p3kod8Vfys3E+A==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/digest-header": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/digest-header/-/digest-header-1.1.0.tgz", + "integrity": "sha512-glXVh42vz40yZb9Cq2oMOt70FIoWiv+vxNvdKdU8CwjLad25qHM3trLxhl9bVjdr6WaslIXhWpn0NO8T/67Qjg==", + "license": "MIT", + "engines": { + "node": ">= 8.0.0" + } + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "license": "MIT", + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/dot-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/dot-case/-/dot-case-3.0.4.tgz", + "integrity": "sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==", + "license": "MIT", + "dependencies": { + "no-case": "^3.0.4", + "tslib": "^2.0.3" + } + }, + "node_modules/dot-prop": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.1.tgz", + "integrity": "sha512-l0p4+mIuJIua0mhxGoh4a+iNL9bmeK5DvnSVQa6T0OhrVmaEa1XScX5Etc673FePCJOArq/4Pa2cLGODUWTPOQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-obj": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/dottie": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/dottie/-/dottie-2.0.7.tgz", + "integrity": "sha512-7lAK2A0b3zZr3UC5aE69CPdCFR4RHW1o2Dr74TqFykxkUCBXSRJum/yPc7g8zRHJqWKomPLHwFLLoUnn8PXXRg==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", + "license": "MIT" + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/duplexer": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz", + "integrity": "sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==", + "license": "MIT" + }, + "node_modules/duplexify": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", + "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", + "license": "MIT", + "dependencies": { + "end-of-stream": "^1.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.0.0", + "stream-shift": "^1.0.0" + } + }, + "node_modules/duplexify/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "license": "MIT" + }, + "node_modules/duplexify/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "license": "MIT", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/duplexify/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "license": "MIT" + }, + "node_modules/duplexify/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true, + "license": "MIT" + }, + "node_modules/ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "license": "Apache-2.0", + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "license": "MIT" + }, + "node_modules/egg": { + "version": "3.34.0", + "resolved": "https://registry.npmjs.org/egg/-/egg-3.34.0.tgz", + "integrity": "sha512-Zs4gwrp/iY7Vkdfm4/UTy1cZrEcWuK9ZiBix30Sco5ennR6k7TcsssYfIS40lgVvI7U4HwcR9HOmhYML3A0A3w==", + "license": "MIT", + "dependencies": { + "@types/accepts": "^1.3.5", + "@types/koa": "^2.13.5", + "@types/koa-router": "^7.4.4", + "accepts": "^1.3.8", + "agentkeepalive": "^4.2.1", + "cache-content-type": "^1.0.1", + "circular-json-for-egg": "^1.0.0", + "cluster-client": "^3.3.0", + "delegates": "^1.0.0", + "egg-cluster": "^2.0.0", + "egg-cookies": "^2.6.1", + "egg-core": "^5.4.0", + "egg-development": "^3.0.0", + "egg-errors": "^2.3.1", + "egg-i18n": "^2.1.1", + "egg-jsonp": "^2.0.0", + "egg-logger": "^3.0.1", + "egg-logrotator": "^3.1.0", + "egg-multipart": "^3.1.0", + "egg-onerror": "^2.1.1", + "egg-schedule": "^4.0.0", + "egg-security": "^3.0.0", + "egg-session": "^3.3.0", + "egg-static": "^2.2.0", + "egg-view": "^2.1.3", + "egg-watcher": "^3.1.1", + "extend2": "^1.0.1", + "graceful": "^1.1.0", + "humanize-ms": "^1.2.1", + "is-type-of": "^2.1.0", + "koa-bodyparser": "^4.4.1", + "koa-is-json": "^1.0.0", + "koa-override": "^3.0.0", + "ms": "^2.1.3", + "on-finished": "^2.4.1", + "onelogger": "^1.0.0", + "sendmessage": "^2.0.0", + "urllib": "^2.33.0", + "urllib-next": "npm:urllib@^3.27.1", + "urllib4": "npm:urllib@^4.5.0", + "utility": "^2.1.0", + "ylru": "^1.3.2" + }, + "engines": { + "node": ">= 14.20.0" + } + }, + "node_modules/egg-bin": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/egg-bin/-/egg-bin-6.13.0.tgz", + "integrity": "sha512-dlztm1Y5DnSkofCeTaMf+O7kARPDGFbcbLDJ5cc029qRRbhStM7AsBBgLc+EEZuumZupejDHdvxraXRVut1ZTA==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "@artus-cli/artus-cli": "^0.2.9", + "@artus-cli/plugin-autocomplete": "^0.1.1", + "@artus-cli/plugin-version": "^1.0.1", + "@eggjs/utils": "^4.0.2", + "c8": "^10.0.0", + "detect-port": "^2.0.0", + "egg-ts-helper": "^2.1.0", + "globby": "^11.1.0", + "jest-changed-files": "^29.4.2", + "mocha": "^10.2.0", + "mochawesome-with-mocha": "^7.1.3", + "runscript": "^2.0.0", + "ts-node": "^10.9.2", + "tsconfig-paths": "^4.1.2" + }, + "bin": { + "egg-bin": "dist/bin/cli.js" + }, + "engines": { + "node": ">= 16.19.0" + }, + "peerDependencies": { + "egg-mock": ">=5.10.2" + }, + "peerDependenciesMeta": { + "egg-mock": { + "optional": true + } + } + }, + "node_modules/egg-cluster": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/egg-cluster/-/egg-cluster-2.5.0.tgz", + "integrity": "sha512-5ySrghDOL6eWvjWpyGKzmLKPkhhD590TWEtdEGBvKRTY/ATquL5/AuQMG5qHOv9dbo7lCxTi9elyVNuJGe0qsA==", + "license": "MIT", + "dependencies": { + "await-event": "^2.1.0", + "cfork": "^1.7.1", + "cluster-reload": "^1.0.2", + "detect-port": "^2.0.1", + "egg-logger": "^3.3.0", + "egg-utils": "^2.4.1", + "get-ready": "^2.0.1", + "graceful-process": "^1.2.0", + "is-type-of": "^1.2.1", + "ps-tree": "^1.2.0", + "sendmessage": "^1.1.0", + "terminal-link": "^2.1.1", + "utility": "^1.15.0" + }, + "engines": { + "node": ">= 14.0.0" + } + }, + "node_modules/egg-cluster/node_modules/is-type-of": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/is-type-of/-/is-type-of-1.4.0.tgz", + "integrity": "sha512-EddYllaovi5ysMLMEN7yzHEKh8A850cZ7pykrY1aNRQGn/CDjRDE9qEWbIdt7xGEVJmjBXzU/fNnC4ABTm8tEQ==", + "license": "MIT", + "dependencies": { + "core-util-is": "^1.0.2", + "is-class-hotfix": "~0.0.6", + "isstream": "~0.1.2" + } + }, + "node_modules/egg-cluster/node_modules/sendmessage": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/sendmessage/-/sendmessage-1.1.0.tgz", + "integrity": "sha512-riI/U2etmtMKaVPe7zMnr++eG46F191F6Zycwrkm+/sEiHzucNXJETPJ5dQryNaDuHTpYdzmesEJQ2le1DxlMQ==", + "license": "MIT", + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/egg-cluster/node_modules/utility": { + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/utility/-/utility-1.18.0.tgz", + "integrity": "sha512-PYxZDA+6QtvRvm//++aGdmKG/cI07jNwbROz0Ql+VzFV1+Z0Dy55NI4zZ7RHc9KKpBePNFwoErqIuqQv/cjiTA==", + "license": "MIT", + "dependencies": { + "copy-to": "^2.0.1", + "escape-html": "^1.0.3", + "mkdirp": "^0.5.1", + "mz": "^2.7.0", + "unescape": "^1.0.1" + }, + "engines": { + "node": ">= 0.12.0" + } + }, + "node_modules/egg-cookies": { + "version": "2.10.1", + "resolved": "https://registry.npmjs.org/egg-cookies/-/egg-cookies-2.10.1.tgz", + "integrity": "sha512-fjlGF9jIu0GmU0bA+ZGOoz8OhbUECy18Y69wgpt8secmtaFzSbKay3DhKA13evqUDoiag5vQXQaN+N7Pp8vFsA==", + "license": "MIT", + "dependencies": { + "scmp": "^2.0.0", + "should-send-same-site-none": "^2.0.2", + "utility": "^1.14.0" + }, + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/egg-cookies/node_modules/utility": { + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/utility/-/utility-1.18.0.tgz", + "integrity": "sha512-PYxZDA+6QtvRvm//++aGdmKG/cI07jNwbROz0Ql+VzFV1+Z0Dy55NI4zZ7RHc9KKpBePNFwoErqIuqQv/cjiTA==", + "license": "MIT", + "dependencies": { + "copy-to": "^2.0.1", + "escape-html": "^1.0.3", + "mkdirp": "^0.5.1", + "mz": "^2.7.0", + "unescape": "^1.0.1" + }, + "engines": { + "node": ">= 0.12.0" + } + }, + "node_modules/egg-core": { + "version": "5.5.1", + "resolved": "https://registry.npmjs.org/egg-core/-/egg-core-5.5.1.tgz", + "integrity": "sha512-6oLO6tLv40vraka+OxXHwaLeXHt/0XRuJlY7zlsz9tS6Z42xDGgjpYXUC2hsFEWQD+SdshC4kTEXllHvplxsqQ==", + "license": "MIT", + "dependencies": { + "@eggjs/router": "^2.2.0", + "@types/depd": "^1.1.32", + "@types/koa": "^2.13.5", + "co": "^4.6.0", + "debug": "^4.1.1", + "depd": "^2.0.0", + "egg-logger": "^3.1.0", + "egg-path-matching": "^1.2.0", + "extend2": "^1.0.0", + "gals": "^1.0.1", + "get-ready": "^2.0.1", + "globby": "^11.0.2", + "is-type-of": "^1.2.1", + "koa": "^2.14.0", + "koa-convert": "^1.2.0", + "node-homedir": "^1.1.1", + "ready-callback": "^3.0.0", + "tsconfig-paths": "^4.1.1", + "utility": "^1.16.1" + }, + "engines": { + "node": ">= 14.19.0" + } + }, + "node_modules/egg-core/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/egg-core/node_modules/is-type-of": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/is-type-of/-/is-type-of-1.4.0.tgz", + "integrity": "sha512-EddYllaovi5ysMLMEN7yzHEKh8A850cZ7pykrY1aNRQGn/CDjRDE9qEWbIdt7xGEVJmjBXzU/fNnC4ABTm8tEQ==", + "license": "MIT", + "dependencies": { + "core-util-is": "^1.0.2", + "is-class-hotfix": "~0.0.6", + "isstream": "~0.1.2" + } + }, + "node_modules/egg-core/node_modules/utility": { + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/utility/-/utility-1.18.0.tgz", + "integrity": "sha512-PYxZDA+6QtvRvm//++aGdmKG/cI07jNwbROz0Ql+VzFV1+Z0Dy55NI4zZ7RHc9KKpBePNFwoErqIuqQv/cjiTA==", + "license": "MIT", + "dependencies": { + "copy-to": "^2.0.1", + "escape-html": "^1.0.3", + "mkdirp": "^0.5.1", + "mz": "^2.7.0", + "unescape": "^1.0.1" + }, + "engines": { + "node": ">= 0.12.0" + } + }, + "node_modules/egg-development": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/egg-development/-/egg-development-3.0.2.tgz", + "integrity": "sha512-sxJzgw+EwfaZhrVcoGniLBT3B3Xd99VsNZnpLKrYp35upaLqw+tCB+kaTYmXZYqXv1Zm2c6RoGCvJbyqr+Mkjw==", + "license": "MIT", + "dependencies": { + "debounce": "^1.1.0", + "multimatch": "^5.0.0", + "utility": "^2.4.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/egg-errors": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/egg-errors/-/egg-errors-2.3.2.tgz", + "integrity": "sha512-E+Sx7IBVrfRyHSjFXaq4sCZ3Uk3ka9PYySaQ8VbRZmLEt9ENBCD99yVzLIeWUH2QfzvkrjY9El1eHmLeRx7cfw==", + "license": "MIT", + "engines": { + "node": ">=8.9.0" + } + }, + "node_modules/egg-i18n": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/egg-i18n/-/egg-i18n-2.1.1.tgz", + "integrity": "sha512-rpKP2nrUzeTOkjQObvlrLbb/BZAMtP7zeoGggwJLN9+zKbFKVkeF6Q0BrpuucDSekD+2oHQz7fC3w/5eQY1g8w==", + "license": "MIT", + "dependencies": { + "debug": "^3.1.0", + "koa-locales": "^1.11.0" + }, + "engines": { + "node": ">= 8.0.0" + } + }, + "node_modules/egg-jsonp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/egg-jsonp/-/egg-jsonp-2.0.0.tgz", + "integrity": "sha512-dno7BXAvSFO0WTb3GJD0aci9MFlaQhdgvEznwARam75GGJdLpg1K0XQq88/dEvYWHxEHa+iGIOXcNx5NOyyUHw==", + "license": "MIT", + "dependencies": { + "is-type-of": "^1.2.0", + "jsonp-body": "^1.0.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/egg-jsonp/node_modules/is-type-of": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/is-type-of/-/is-type-of-1.4.0.tgz", + "integrity": "sha512-EddYllaovi5ysMLMEN7yzHEKh8A850cZ7pykrY1aNRQGn/CDjRDE9qEWbIdt7xGEVJmjBXzU/fNnC4ABTm8tEQ==", + "license": "MIT", + "dependencies": { + "core-util-is": "^1.0.2", + "is-class-hotfix": "~0.0.6", + "isstream": "~0.1.2" + } + }, + "node_modules/egg-logger": { + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/egg-logger/-/egg-logger-3.6.1.tgz", + "integrity": "sha512-lGiEumARJAT7NiwMm577NFiOEBMX9FlZzfuBsLLS6eu14R9udcTI1IzXLGJ63SrCmFIXB+zsWLQv5U11e8fq0Q==", + "license": "MIT", + "dependencies": { + "chalk": "^4.1.2", + "circular-json-for-egg": "^1.0.0", + "depd": "^2.0.0", + "egg-errors": "^2.3.1", + "iconv-lite": "^0.6.3", + "utility": "^2.1.0" + }, + "engines": { + "node": ">=14.17.0" + } + }, + "node_modules/egg-logger/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/egg-logger/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/egg-logger/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/egg-logger/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "license": "MIT" + }, + "node_modules/egg-logger/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/egg-logger/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/egg-logrotator": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/egg-logrotator/-/egg-logrotator-3.2.0.tgz", + "integrity": "sha512-2KYN4wwBd15FYbNtLxL7IoIkFL7JuHHA3eXWZd5zVKfWgeoy4J+oTnCLDixW1UhVIdehL0q1oQxEldWm5af1Eg==", + "license": "MIT", + "dependencies": { + "moment": "^2.24.0", + "mz": "^2.7.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/egg-mock": { + "version": "5.15.2", + "resolved": "https://registry.npmjs.org/egg-mock/-/egg-mock-5.15.2.tgz", + "integrity": "sha512-8g+GzGcjfPaM/XwGaoej27wfIw7qeKR3tqYZPB3mIRWMzChYnyI2Bb+5qud23Ealj0raNamE+85ZsBKI2kq8nw==", + "dev": true, + "dependencies": { + "@eggjs/utils": "^4.0.2", + "@types/supertest": "^2.0.7", + "await-event": "^2.1.0", + "co": "^4.6.0", + "coffee": "^5.2.1", + "detect-port": "^2.0.1", + "egg-logger": "^3.5.0", + "extend2": "^1.0.0", + "get-ready": "^3.1.0", + "globby": "^11.1.0", + "is-type-of": "^2.2.0", + "merge-descriptors": "^1.0.1", + "methods": "^1.1.2", + "mm": "^3.0.2", + "sdk-base": "^4.2.1", + "supertest": "^6.2.4", + "urllib": "3" + }, + "engines": { + "node": ">= 14.18.0" + }, + "peerDependencies": { + "egg": "^3.12.0", + "mocha": "^10.2.0", + "urllib": "^3 || ^4" + } + }, + "node_modules/egg-mock/node_modules/get-ready": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/get-ready/-/get-ready-3.4.0.tgz", + "integrity": "sha512-D7N1WED4f5rQUveyl19GxfJupMeR+y106EVK6na/zI+w34FcTAShvetX0X2k61x+lJXCEiOnGHk0xro6YRyrjQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 16.13.0" + } + }, + "node_modules/egg-mock/node_modules/type-fest": { + "version": "4.41.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.41.0.tgz", + "integrity": "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/egg-mock/node_modules/urllib": { + "version": "3.27.3", + "resolved": "https://registry.npmjs.org/urllib/-/urllib-3.27.3.tgz", + "integrity": "sha512-24ht/hHAkhWXbqSCM499B8gFPXaf4aFQJNqJH5pMsvfyo+aM3zKuQ/uiZ/mdz41Nnw6ItuiqMVMK5VDAlAHLlw==", + "dev": true, + "license": "MIT", + "dependencies": { + "default-user-agent": "^1.0.0", + "digest-header": "^1.0.0", + "form-data-encoder": "^1.7.2", + "formdata-node": "^4.3.3", + "formstream": "^1.1.1", + "mime-types": "^2.1.35", + "pump": "^3.0.0", + "qs": "^6.11.2", + "type-fest": "^4.3.1", + "undici": "^5.28.2", + "ylru": "^1.3.2" + }, + "engines": { + "node": ">= 14.19.3" + } + }, + "node_modules/egg-multipart": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/egg-multipart/-/egg-multipart-3.5.0.tgz", + "integrity": "sha512-AWJ50gr+toCvixgtHvLXbtzemJuqnbtJtBZbBNZ8/ADONvOZ9Ib7lkvzcA4Wq0lypfa0rtlLDRq8A09wOd6tVA==", + "license": "MIT", + "dependencies": { + "co-busboy": "^2.0.0", + "dayjs": "^1.11.5", + "egg-path-matching": "^1.2.0", + "humanize-bytes": "^1.0.1" + }, + "engines": { + "node": ">= 14.17.0" + } + }, + "node_modules/egg-onerror": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/egg-onerror/-/egg-onerror-2.4.0.tgz", + "integrity": "sha512-btmUsP1m6H9awd1IaAlvlzqN+uIbUKzaxJ8ArZI71r5FQ9LShZGv2pOT5fhL9mSnGkrvHUsjb9I5KoX2AY63bA==", + "dependencies": { + "cookie": "^0.7.2", + "koa-onerror": "^4.0.0", + "mustache": "^2.3.0", + "stack-trace": "^0.0.10" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/egg-path-matching": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/egg-path-matching/-/egg-path-matching-1.2.0.tgz", + "integrity": "sha512-u88hY0tH8GfWu4iocWFxux/abXvi7bh4lr/GIRlUHCTJFk8RQNCCfk5H3Vm67pqTBljtBOCl0lLykOsxj8trXQ==", + "license": "MIT", + "dependencies": { + "path-to-regexp": "^1.9.0" + } + }, + "node_modules/egg-redis": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/egg-redis/-/egg-redis-2.6.1.tgz", + "integrity": "sha512-YZaoPS/9tVe68CakYUTFZ4a/+NpC3zO6SQxD72SI5DOZaMKlrOPlPPeJYa5kFRHybS29dtQEZ6Hlitbu1tgTcA==", + "license": "MIT", + "dependencies": { + "@types/ioredis": "^4.0.10", + "await-first": "^1.0.0", + "ioredis": "^4.9.0" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/egg-schedule": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/egg-schedule/-/egg-schedule-4.0.1.tgz", + "integrity": "sha512-9BgIEOA5+jsqqvW8qLj/0SbTHkr9t2vNRBbZQkqqscejocViGysGd866vN+rcpuqd2zmnP6EQ0YqPAV5fI8P6Q==", + "license": "MIT", + "dependencies": { + "cron-parser": "^2.16.3", + "humanize-ms": "^1.2.1", + "is-type-of": "^1.2.1", + "safe-timers": "^1.1.0", + "utility": "^1.16.3" + }, + "engines": { + "node": ">=14.17.0" + } + }, + "node_modules/egg-schedule/node_modules/is-type-of": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/is-type-of/-/is-type-of-1.4.0.tgz", + "integrity": "sha512-EddYllaovi5ysMLMEN7yzHEKh8A850cZ7pykrY1aNRQGn/CDjRDE9qEWbIdt7xGEVJmjBXzU/fNnC4ABTm8tEQ==", + "license": "MIT", + "dependencies": { + "core-util-is": "^1.0.2", + "is-class-hotfix": "~0.0.6", + "isstream": "~0.1.2" + } + }, + "node_modules/egg-schedule/node_modules/utility": { + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/utility/-/utility-1.18.0.tgz", + "integrity": "sha512-PYxZDA+6QtvRvm//++aGdmKG/cI07jNwbROz0Ql+VzFV1+Z0Dy55NI4zZ7RHc9KKpBePNFwoErqIuqQv/cjiTA==", + "license": "MIT", + "dependencies": { + "copy-to": "^2.0.1", + "escape-html": "^1.0.3", + "mkdirp": "^0.5.1", + "mz": "^2.7.0", + "unescape": "^1.0.1" + }, + "engines": { + "node": ">= 0.12.0" + } + }, + "node_modules/egg-scripts": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/egg-scripts/-/egg-scripts-3.1.0.tgz", + "integrity": "sha512-NnaQRKDTEDgxnM07bipkjwCQ+fuN3/c8EHX0sTkCAdwEzkwiPbEBDEICmDppgSqSBlw2YXwizhk0AWEtm9EVWw==", + "license": "MIT", + "dependencies": { + "await-event": "^2.1.0", + "common-bin": "^3.0.1", + "egg-utils": "^2.5.0", + "mz": "^2.7.0", + "mz-modules": "^2.1.0", + "node-homedir": "^1.1.1", + "runscript": "^2.0.1", + "source-map-support": "^0.5.9", + "utility": "^2.2.0", + "zlogger": "^1.1.0" + }, + "bin": { + "egg-scripts": "bin/egg-scripts.js", + "eggctl": "bin/egg-scripts.js" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/egg-security": { + "version": "3.8.1", + "resolved": "https://registry.npmjs.org/egg-security/-/egg-security-3.8.1.tgz", + "integrity": "sha512-zFGjDo+Z9X0lv2QAWeE7I+LAvP77uqTDNP3+xfgj6g5MYVLLPfubIVli9CemViYBhVmcXm3uvm2vFibFzxN+qQ==", + "license": "MIT", + "dependencies": { + "@eggjs/ip": "^2.0.2", + "csrf": "^3.0.6", + "delegates": "^1.0.0", + "egg-path-matching": "^1.2.0", + "escape-html": "^1.0.3", + "extend": "^3.0.1", + "koa-compose": "^4.1.0", + "matcher": "^4.0.0", + "methods": "^1.1.2", + "nanoid": "^3.3.6", + "platform": "^1.3.4", + "statuses": "^2.0.1", + "type-is": "^1.6.15", + "xss": "^1.0.3" + }, + "engines": { + "node": ">=14.20.0" + } + }, + "node_modules/egg-sequelize": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/egg-sequelize/-/egg-sequelize-6.0.0.tgz", + "integrity": "sha512-uEeBWydcvkFNIVsshE9ZMZXgPmnOtSA+PzKXXoRgOsbN0DqzBRxcdpV4OiW0q3u5f9cfSg/h2HD7imw/z7LGnQ==", + "license": "MIT", + "dependencies": { + "@types/sequelize": "^4.27.24", + "mz-modules": "^2.1.0", + "sequelize": "^6.0.0" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/egg-session": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/egg-session/-/egg-session-3.3.0.tgz", + "integrity": "sha512-RCPWHLWi0Ak+xI/zXN71Wpva/wsqevmKDvkOGk2uu5UdwRHw5lKuTtYm161NMDGZi6lvcnzR2lN7xRcDuhGiIw==", + "dependencies": { + "koa-session": "^6.0.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/egg-static": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/egg-static/-/egg-static-2.3.1.tgz", + "integrity": "sha512-OODn2ccm4znFM/EdhiPUmIpgCkYvAdtjuVAy3N/Ub4cSRgqIPcjXajmDsbhEo43mCieukPhsOxgWD3vKZurzHQ==", + "license": "MIT", + "dependencies": { + "is-type-of": "^1.2.1", + "koa-compose": "^4.1.0", + "koa-range": "^0.3.0", + "koa-static-cache": "^5.1.2", + "ylru": "^1.3.2" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/egg-static/node_modules/is-type-of": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/is-type-of/-/is-type-of-1.4.0.tgz", + "integrity": "sha512-EddYllaovi5ysMLMEN7yzHEKh8A850cZ7pykrY1aNRQGn/CDjRDE9qEWbIdt7xGEVJmjBXzU/fNnC4ABTm8tEQ==", + "license": "MIT", + "dependencies": { + "core-util-is": "^1.0.2", + "is-class-hotfix": "~0.0.6", + "isstream": "~0.1.2" + } + }, + "node_modules/egg-ts-helper": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/egg-ts-helper/-/egg-ts-helper-2.1.1.tgz", + "integrity": "sha512-/uA9aPi9ptAvT8NIASv20bJftTdGZb5L3wFX2q74IBNGF9hBZW4CX9b80driXNFYpL9z6BusZ1qkGZwzRWkykA==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.0.0", + "chokidar": "^3.0.0", + "commander": "^2.15.1", + "dot-prop": "^4.2.0", + "enquirer": "^2.3.0", + "globby": "^11.0.0", + "json5": "^2.2.3", + "ts-node": "^10.9.1", + "tslib": "^2.6.1", + "typescript": "^5.1.6", + "yn": "^3.0.0" + }, + "bin": { + "ets": "dist/bin.js" + }, + "engines": { + "node": ">= 14.21.3" + } + }, + "node_modules/egg-ts-helper/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/egg-ts-helper/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/egg-ts-helper/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/egg-ts-helper/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/egg-ts-helper/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/egg-ts-helper/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/egg-ts-helper/node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/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/egg-utils": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/egg-utils/-/egg-utils-2.5.0.tgz", + "integrity": "sha512-zQDXcqD0v+6IDBxcxzpTWoDTMg0G3iISSSeOHN7dZzyJWXXmw4ijBPAwKQPVvqBoXB6jAXj5f8B8/LVM9AN//A==", + "license": "MIT", + "dependencies": { + "mkdirp": "^0.5.1", + "utility": "^1.15.0" + } + }, + "node_modules/egg-utils/node_modules/utility": { + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/utility/-/utility-1.18.0.tgz", + "integrity": "sha512-PYxZDA+6QtvRvm//++aGdmKG/cI07jNwbROz0Ql+VzFV1+Z0Dy55NI4zZ7RHc9KKpBePNFwoErqIuqQv/cjiTA==", + "license": "MIT", + "dependencies": { + "copy-to": "^2.0.1", + "escape-html": "^1.0.3", + "mkdirp": "^0.5.1", + "mz": "^2.7.0", + "unescape": "^1.0.1" + }, + "engines": { + "node": ">= 0.12.0" + } + }, + "node_modules/egg-view": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/egg-view/-/egg-view-2.1.4.tgz", + "integrity": "sha512-8zJ/S7YU5SK3EbAYESlUCixLpDZPnyKimoowavrgW2vONnh8AJVuDGqgKCYmuymvWq3uaHoNx7mYbdMQwMTZ6A==", + "license": "MIT", + "dependencies": { + "mz": "^2.7.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/egg-watcher": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/egg-watcher/-/egg-watcher-3.1.1.tgz", + "integrity": "sha512-fLo8f2GD9kSrAKeDoXaCckl9MaMMwTEkqU9gVDYWYGPYLsmX79ugA+Wo/2RGQkytsxSCk3bn8YqhPdMzsozgWA==", + "dependencies": { + "camelcase": "^5.0.0", + "sdk-base": "^3.5.0", + "wt": "^1.2.0" + }, + "engines": { + "node": ">= 8.0.0" + } + }, + "node_modules/egg-watcher/node_modules/is-type-of": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/is-type-of/-/is-type-of-1.4.0.tgz", + "integrity": "sha512-EddYllaovi5ysMLMEN7yzHEKh8A850cZ7pykrY1aNRQGn/CDjRDE9qEWbIdt7xGEVJmjBXzU/fNnC4ABTm8tEQ==", + "license": "MIT", + "dependencies": { + "core-util-is": "^1.0.2", + "is-class-hotfix": "~0.0.6", + "isstream": "~0.1.2" + } + }, + "node_modules/egg-watcher/node_modules/sdk-base": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/sdk-base/-/sdk-base-3.6.0.tgz", + "integrity": "sha512-jxHUIrRLlAoRFRwiXKhOGjd6BeFWO/jz7tv+E7lbMSef6F9jzFN2Sv3hLW58oDDKscKaBGG6vQdkbXn7isE7fw==", + "license": "MIT", + "dependencies": { + "await-event": "^2.1.0", + "await-first": "^1.0.0", + "co": "^4.6.0", + "is-type-of": "^1.2.1" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/end-of-stream": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz", + "integrity": "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==", + "license": "MIT", + "dependencies": { + "once": "^1.4.0" + } + }, + "node_modules/enquirer": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.4.1.tgz", + "integrity": "sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-colors": "^4.1.1", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.2.tgz", + "integrity": "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/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/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "license": "MIT" + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/event-stream": { + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz", + "integrity": "sha512-QHpkERcGsR0T7Qm3HNJSyXKEEj8AHNxkY3PK8TS2KJvQ7NiSHe3DDpwVKKtoYprL/AreyzFBeIkBIWChAqn60g==", + "license": "MIT", + "dependencies": { + "duplexer": "~0.1.1", + "from": "~0", + "map-stream": "~0.1.0", + "pause-stream": "0.0.11", + "split": "0.3", + "stream-combiner": "~0.0.4", + "through": "~2.3.1" + } + }, + "node_modules/eventemitter3": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", + "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", + "license": "MIT" + }, + "node_modules/execa": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "dev": true, + "license": "MIT", + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/execa/node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/execa/node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/execa/node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/execa/node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/execa/node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/execa/node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "license": "MIT" + }, + "node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "license": "MIT", + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/extend2": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/extend2/-/extend2-1.0.1.tgz", + "integrity": "sha512-ISoKeVhtewd5YHzMo+r9KC3Zx0fdpNBqoRzot+6BeEQ3bWQYQQOt0jkkY5gLveI2e7j+vdCJKeszHJIbg2Uceg==", + "license": "MIT" + }, + "node_modules/fast-glob": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", + "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.8" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-safe-stringify": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz", + "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==", + "dev": true, + "license": "MIT" + }, + "node_modules/fastq": { + "version": "1.20.3", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.20.3.tgz", + "integrity": "sha512-XKv5nnLs6nLF71NgiKJLIZFLkPyIEuOselLG7ujZnGrRfQK8HpvY+WqKhAJUAdLomwVHErVS4LfxFlPq0/FTAw==", + "license": "ISC", + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/figures": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", + "dev": true, + "license": "MIT", + "dependencies": { + "escape-string-regexp": "^1.0.5" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "dev": true, + "license": "BSD-3-Clause", + "bin": { + "flat": "cli.js" + } + }, + "node_modules/follow-redirects": { + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.16.1.tgz", + "integrity": "sha512-FNvFGzoMLWmE6Yj9spb/zjd7yiNCHiAW9/Tg9CXrQ8wuu32HtlJOwWO11OJafl5FfY3DxTdQ0vj42zU1kvv5jg==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "license": "MIT", + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/foreground-child": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", + "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", + "dev": true, + "license": "ISC", + "dependencies": { + "cross-spawn": "^7.0.6", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/foreground-child/node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/foreground-child/node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/foreground-child/node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/foreground-child/node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/foreground-child/node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/form-data": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/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/form-data-encoder": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/form-data-encoder/-/form-data-encoder-1.9.0.tgz", + "integrity": "sha512-rahaRMkN8P8d/tgK/BLPX+WBVM27NbvdXBxqQujBtkDAIFspaRqN7Od7lfdGQA6KAD+f82fYCLBq1ipvcu8qLw==", + "license": "MIT" + }, + "node_modules/formdata-node": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/formdata-node/-/formdata-node-4.4.1.tgz", + "integrity": "sha512-0iirZp3uVDjVGt9p49aTaqjk84TrglENEDuqfdlZQ1roC9CWlPk6Avf8EEnZNcAqPonwkG35x4n3ww/1THYAeQ==", + "license": "MIT", + "dependencies": { + "node-domexception": "1.0.0", + "web-streams-polyfill": "4.0.0-beta.3" + }, + "engines": { + "node": ">= 12.20" + } + }, + "node_modules/formidable": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/formidable/-/formidable-2.1.5.tgz", + "integrity": "sha512-Oz5Hwvwak/DCaXVVUtPn4oLMLLy1CdclLKO1LFgU7XzDpVMUU5UjlSLpGMocyQNNk8F6IJW9M/YdooSn2MRI+Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@paralleldrive/cuid2": "^2.2.2", + "dezalgo": "^1.0.4", + "once": "^1.4.0", + "qs": "^6.11.0" + }, + "funding": { + "url": "https://ko-fi.com/tunnckoCore/commissions" + } + }, + "node_modules/formstream": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/formstream/-/formstream-1.5.2.tgz", + "integrity": "sha512-NASf0lgxC1AyKNXQIrXTEYkiX99LhCEXTkiGObXAkpBui86a4u8FjH1o2bGb3PpqI3kafC+yw4zWeK6l6VHTgg==", + "license": "MIT", + "dependencies": { + "destroy": "^1.0.4", + "mime": "^2.5.2", + "node-hex": "^1.0.1", + "pause-stream": "~0.0.11" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/from": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/from/-/from-0.1.7.tgz", + "integrity": "sha512-twe20eF1OxVxp/ML/kq2p1uc6KvFK/+vs8WjEbeKmV2He22MKm7YF2ANIt+EOqhJ5L3K/SuuPhk0hWQDjOM23g==", + "license": "MIT" + }, + "node_modules/fs-extra": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", + "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/fs-readdir-recursive": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz", + "integrity": "sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA==", + "license": "MIT" + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "license": "ISC" + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/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/fsu": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/fsu/-/fsu-1.1.1.tgz", + "integrity": "sha512-xQVsnjJ/5pQtcKh+KjUoZGzVWn4uNkchxTF6Lwjr4Gf7nQr8fmUfhKJ62zE77+xQg9xnxi5KUps7XGs+VC986A==", + "dev": true, + "license": "MIT" + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gals": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/gals/-/gals-1.0.2.tgz", + "integrity": "sha512-h5c1Q6Q2cnRkO2v8ZxbuFCNRpM96CjGxGuoNcThoNF3dAEEYagF166EqJmaa9r2/I+ryij8TO3yMmqrMvQ1YXw==", + "license": "MIT", + "engines": { + "node": ">= 16.0.0" + } + }, + "node_modules/generate-function": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.3.1.tgz", + "integrity": "sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==", + "license": "MIT", + "dependencies": { + "is-property": "^1.0.2" + } + }, + "node_modules/generator-function": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/generator-function/-/generator-function-2.0.1.tgz", + "integrity": "sha512-SFdFmIJi+ybC0vjlHN0ZGVGHc3lgE0DxPAT0djjVg+kjOnSqclqmj0KQ7ykTOLP6YxoqOvuAODGdcHJn+43q3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "license": "ISC", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/get-ready": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/get-ready/-/get-ready-2.0.1.tgz", + "integrity": "sha512-q2zoHPGbHognNvofksty0SOrviWowfUVxYcv3j3+Mf1BRRMHmq6q/1pciravEf8jkSL5iovloMWnonEc2QOpqA==", + "license": "MIT", + "dependencies": { + "is-type-of": "^1.0.0" + }, + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/get-ready/node_modules/is-type-of": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/is-type-of/-/is-type-of-1.4.0.tgz", + "integrity": "sha512-EddYllaovi5ysMLMEN7yzHEKh8A850cZ7pykrY1aNRQGn/CDjRDE9qEWbIdt7xGEVJmjBXzU/fNnC4ABTm8tEQ==", + "license": "MIT", + "dependencies": { + "core-util-is": "^1.0.2", + "is-class-hotfix": "~0.0.6", + "isstream": "~0.1.2" + } + }, + "node_modules/get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/glob": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", + "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "license": "MIT", + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/graceful/-/graceful-1.1.0.tgz", + "integrity": "sha512-sImEQVLLBo8hSeX4Vp6HVdWSdqCkHoVlZwBuBL65tNwcPTvnMaW40iWs1vdCbyP0znkCEuvv6rZ37QPloPi9Fw==", + "license": "MIT", + "dependencies": { + "humanize-ms": "^1.2.1", + "ps-tree": "^1.1.0" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/graceful-process": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/graceful-process/-/graceful-process-1.3.0.tgz", + "integrity": "sha512-tlldpcdxQgSgVD/A+OawlyjGU9Z+wbBTI6QroGo4u6znQNLgglp+V2KnixRHUXRttnrCpbQSSCJ6wvsMkzR9Aw==", + "license": "MIT", + "dependencies": { + "is-type-of": "^1.2.0", + "once": "^1.4.0" + } + }, + "node_modules/graceful-process/node_modules/is-type-of": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/is-type-of/-/is-type-of-1.4.0.tgz", + "integrity": "sha512-EddYllaovi5ysMLMEN7yzHEKh8A850cZ7pykrY1aNRQGn/CDjRDE9qEWbIdt7xGEVJmjBXzU/fNnC4ABTm8tEQ==", + "license": "MIT", + "dependencies": { + "core-util-is": "^1.0.2", + "is-class-hotfix": "~0.0.6", + "isstream": "~0.1.2" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/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.npmjs.org/hasown/-/hasown-2.0.4.tgz", + "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true, + "license": "MIT", + "bin": { + "he": "bin/he" + } + }, + "node_modules/header-case": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/header-case/-/header-case-2.0.4.tgz", + "integrity": "sha512-H/vuk5TEEVZwrR0lp2zed9OCo1uAILMlx0JEMgC26rzyJJ3N1v6XkwHHXJQdR2doSjcGPM6OKPYoJgf0plJ11Q==", + "license": "MIT", + "dependencies": { + "capital-case": "^1.0.4", + "tslib": "^2.0.3" + } + }, + "node_modules/html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true, + "license": "MIT" + }, + "node_modules/http-assert": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/http-assert/-/http-assert-1.5.0.tgz", + "integrity": "sha512-uPpH7OKX4H25hBmU6G1jWNaqJGpTXxey+YOUizJUAgu0AjLUeC8D73hTrhvDS5D+GJN1DN1+hhc/eF/wpxtp0w==", + "license": "MIT", + "dependencies": { + "deep-equal": "~1.0.1", + "http-errors": "~1.8.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/http-errors": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz", + "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==", + "license": "MIT", + "dependencies": { + "depd": "~1.1.2", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/http-errors/node_modules/depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/http-errors/node_modules/statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/http-proxy": { + "version": "1.18.1", + "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz", + "integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==", + "license": "MIT", + "dependencies": { + "eventemitter3": "^4.0.0", + "follow-redirects": "^1.0.0", + "requires-port": "^1.0.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=10.17.0" + } + }, + "node_modules/humanize-bytes": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/humanize-bytes/-/humanize-bytes-1.0.1.tgz", + "integrity": "sha512-OZMIHt5YhQM4S3R82KGoKnWv4vaNnWuEhPAK+u5v7rD2tRM3DU2NghYEHipAPYwyTR6+fMVZQ9ETpZIZeZUapQ==", + "license": "MIT", + "dependencies": { + "bytes": "~2.2.0" + } + }, + "node_modules/humanize-ms": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", + "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==", + "license": "MIT", + "dependencies": { + "ms": "^2.0.0" + } + }, + "node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "BSD-3-Clause" + }, + "node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/inflation": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/inflation/-/inflation-2.1.0.tgz", + "integrity": "sha512-t54PPJHG1Pp7VQvxyVCJ9mBbjG3Hqryges9bXoOO6GExCPa+//i/d5GSuFtpx3ALLd7lgIAur6zrIlBQyJuMlQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/inflection": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/inflection/-/inflection-1.13.4.tgz", + "integrity": "sha512-6I/HUDeYFfuNCVS3td055BaXBwKYuzw7K3ExVMStBowKo9oOAMJIXIHvdyR3iboTCp1b+1i5DSkIZTcwIktuDw==", + "engines": [ + "node >= 0.4.0" + ], + "license": "MIT" + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "license": "ISC", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "license": "ISC" + }, + "node_modules/inquirer": { + "version": "8.2.7", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-8.2.7.tgz", + "integrity": "sha512-UjOaSel/iddGZJ5xP/Eixh6dY1XghiBw4XK13rCCIJcJfyhhoul/7KhLLUGtebEj6GDYM6Vnx/mVsjx2L/mFIA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@inquirer/external-editor": "^1.0.0", + "ansi-escapes": "^4.2.1", + "chalk": "^4.1.1", + "cli-cursor": "^3.1.0", + "cli-width": "^3.0.0", + "figures": "^3.0.0", + "lodash": "^4.17.21", + "mute-stream": "0.0.8", + "ora": "^5.4.1", + "run-async": "^2.4.0", + "rxjs": "^7.5.5", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0", + "through": "^2.3.6", + "wrap-ansi": "^6.0.1" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/inquirer/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/inquirer/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/inquirer/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/inquirer/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/inquirer/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/inquirer/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ioredis": { + "version": "4.31.0", + "resolved": "https://registry.npmjs.org/ioredis/-/ioredis-4.31.0.tgz", + "integrity": "sha512-tVrCrc4LWJwX82GD79dZ0teZQGq+5KJEGpXJRgzHOrhHtLgF9ME6rTwDV5+HN5bjnvmtrnS8ioXhflY16sy2HQ==", + "license": "MIT", + "dependencies": { + "@ioredis/commands": "^1.0.2", + "cluster-key-slot": "^1.1.0", + "debug": "^4.3.1", + "denque": "^1.1.0", + "lodash.defaults": "^4.2.0", + "lodash.flatten": "^4.4.0", + "lodash.isarguments": "^3.1.0", + "p-map": "^2.1.0", + "redis-errors": "^1.2.0", + "redis-parser": "^3.0.0", + "standard-as-callback": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/ioredis" + } + }, + "node_modules/ioredis/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "license": "MIT", + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-class-hotfix": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/is-class-hotfix/-/is-class-hotfix-0.0.6.tgz", + "integrity": "sha512-0n+pzCC6ICtVr/WXnN2f03TK/3BfXY7me4cjCAqT8TYXEl0+JBRoqBo94JJHXcyDSLUeWbNX8Fvy5g5RJdAstQ==", + "license": "MIT" + }, + "node_modules/is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-generator-function": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.1.2.tgz", + "integrity": "sha512-upqt1SkGkODW9tsGNG5mtXTXtECizwtS2kA161M+gJPc1xdb/Ax629af6YrTwcOeQHbewrPNlE5Dx7kzvXTizA==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.4", + "generator-function": "^2.0.0", + "get-proto": "^1.0.1", + "has-tostringtag": "^1.0.2", + "safe-regex-test": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-interactive": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", + "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-nan": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/is-nan/-/is-nan-1.3.2.tgz", + "integrity": "sha512-E+zBKpQ2t6MEo1VsonYmluk9NxGrbzpeeLC2xIViuO2EjU2xsXsBPwTr3Ykv9l08UYEVEdWeRZNouaZqF6RN0w==", + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", + "integrity": "sha512-l4RyHgRqGN4Y3+9JHVrNqO+tN0rV5My76uW5/nuO4K1b6vw5G8d/cmFjP9tRfEsdhZNt0IFdZuK/c2Vr4Nb+Qg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-property": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", + "integrity": "sha512-Ks/IoX00TtClbGQr4TWXemAnktAQvYB7HzcCxDGqEZU6oCmb2INHuOoKxbtR+HFkmYWBKv/dOZtGRiAjDhj92g==", + "license": "MIT" + }, + "node_modules/is-regex": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", + "integrity": "sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-type-of": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-type-of/-/is-type-of-2.2.0.tgz", + "integrity": "sha512-72axShMJMnMy5HSU/jLGNOonZD5rWM0MwJSCYpKCTQCbggQZBJO/CLMMVP5HgS8kPSYFBkTysJexsD6NMvGKDQ==", + "license": "MIT" + }, + "node_modules/is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==", + "license": "MIT" + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==", + "license": "MIT" + }, + "node_modules/istanbul-lib-coverage": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", + "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-report": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^4.0.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-report/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-report/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-reports": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.2.0.tgz", + "integrity": "sha512-HGYWWS/ehqTV3xN10i23tkPkpH46MLCIMFNCaaKNavAXTF1RkqxawEPtnjnGZ6XKSInBKkiOA5BKS+aZiY3AvA==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, + "node_modules/jest-changed-files": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.7.0.tgz", + "integrity": "sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==", + "dev": true, + "license": "MIT", + "dependencies": { + "execa": "^5.0.0", + "jest-util": "^29.7.0", + "p-limit": "^3.1.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-util": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", + "integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "graceful-fs": "^4.2.9", + "picomatch": "^2.2.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-util/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/jest-util/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/jest-util/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-util/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/jest-util/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-util/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/js-yaml": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.2.tgz", + "integrity": "sha512-SFNOvSJ+Dgf/9An904Yx+CgSlIPCkIpao4qo51lpee25TIRejdH3rhR4EZMGoNx3/TP3O+wzWuiTFl4sqbltzA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/puzrin" + }, + { + "type": "github", + "url": "https://github.com/sponsors/nodeca" + } + ], + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", + "license": "ISC" + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "license": "MIT", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/jsonfile": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.1.tgz", + "integrity": "sha512-zwOTdL3rFQ/lRdBnntKVOX6k5cKJwEc1HdilT71BWEu7J41gXIB2MRp+vxduPSwZJPWBxEzv4yH1wYLJGUHX4Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/jsonp-body": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/jsonp-body/-/jsonp-body-1.1.0.tgz", + "integrity": "sha512-ZQyNWgHI8vvqclzz0l4/PatmeGureejrdMiLQGxTupMw0yQMHf+pQwS/7d5tpo2NBHsuwLCmXvZeNiz2RKdklA==", + "license": "MIT", + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/jsonwebtoken": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.3.tgz", + "integrity": "sha512-MT/xP0CrubFRNLNKvxJ2BYfy53Zkm++5bX9dtuPbqAeQpTVe0MQTFhao8+Cp//EmJp244xt6Drw/GVEGCUj40g==", + "license": "MIT", + "dependencies": { + "jws": "^4.0.1", + "lodash.includes": "^4.3.0", + "lodash.isboolean": "^3.0.3", + "lodash.isinteger": "^4.0.4", + "lodash.isnumber": "^3.0.3", + "lodash.isplainobject": "^4.0.6", + "lodash.isstring": "^4.0.1", + "lodash.once": "^4.0.0", + "ms": "^2.1.1", + "semver": "^7.5.4" + }, + "engines": { + "node": ">=12", + "npm": ">=6" + } + }, + "node_modules/jsonwebtoken/node_modules/semver": { + "version": "7.8.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", + "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/jwa": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.1.tgz", + "integrity": "sha512-hRF04fqJIP8Abbkq5NKGN0Bbr3JxlQ+qhZufXVr0DvujKy93ZCbXZMHDL4EOtodSbCWxOqR8MS1tXA5hwqCXDg==", + "license": "MIT", + "dependencies": { + "buffer-equal-constant-time": "^1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/jws": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/jws/-/jws-4.0.1.tgz", + "integrity": "sha512-EKI/M/yqPncGUUh44xz0PxSidXFr/+r0pA70+gIYhjv+et7yxM+s29Y+VGDkovRofQem0fs7Uvf4+YmAdyRduA==", + "license": "MIT", + "dependencies": { + "jwa": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/keygrip": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/keygrip/-/keygrip-1.1.0.tgz", + "integrity": "sha512-iYSchDJ+liQ8iwbSI2QqsQOvqv58eJCEanyJPJi+Khyu8smkcKSFUCbPwzFcL7YVtZ6eONjqRX/38caJ7QjRAQ==", + "license": "MIT", + "dependencies": { + "tsscmp": "1.0.6" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/ko-sleep": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/ko-sleep/-/ko-sleep-1.1.4.tgz", + "integrity": "sha512-s05WGpvvzyTuRlRE8fM7ru2Z3O+InbJuBcckTWKg2W+2c1k6SnFa3IfiSSt0/peFrlYAXgNoxuJWWVNmWh+K/A==", + "license": "MIT", + "dependencies": { + "ms": "*" + } + }, + "node_modules/koa": { + "version": "2.16.4", + "resolved": "https://registry.npmjs.org/koa/-/koa-2.16.4.tgz", + "integrity": "sha512-3An0GCLDSR34tsCO4H8Tef8Pp2ngtaZDAZnsWJYelqXUK5wyiHvGItgK/xcSkmHLSTn1Jcho1mRQs2ehRzvKKw==", + "license": "MIT", + "dependencies": { + "accepts": "^1.3.5", + "cache-content-type": "^1.0.0", + "content-disposition": "~0.5.2", + "content-type": "^1.0.4", + "cookies": "~0.9.0", + "debug": "^4.3.2", + "delegates": "^1.0.0", + "depd": "^2.0.0", + "destroy": "^1.0.4", + "encodeurl": "^1.0.2", + "escape-html": "^1.0.3", + "fresh": "~0.5.2", + "http-assert": "^1.3.0", + "http-errors": "^1.6.3", + "is-generator-function": "^1.0.7", + "koa-compose": "^4.1.0", + "koa-convert": "^2.0.0", + "on-finished": "^2.3.0", + "only": "~0.0.2", + "parseurl": "^1.3.2", + "statuses": "^1.5.0", + "type-is": "^1.6.16", + "vary": "^1.1.2" + }, + "engines": { + "node": "^4.8.4 || ^6.10.1 || ^7.10.1 || >= 8.1.4" + } + }, + "node_modules/koa-bodyparser": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/koa-bodyparser/-/koa-bodyparser-4.4.1.tgz", + "integrity": "sha512-kBH3IYPMb+iAXnrxIhXnW+gXV8OTzCu8VPDqvcDHW9SQrbkHmqPQtiZwrltNmSq6/lpipHnT7k7PsjlVD7kK0w==", + "license": "MIT", + "dependencies": { + "co-body": "^6.0.0", + "copy-to": "^2.0.1", + "type-is": "^1.6.18" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/koa-compose": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/koa-compose/-/koa-compose-4.1.0.tgz", + "integrity": "sha512-8ODW8TrDuMYvXRwra/Kh7/rJo9BtOfPc6qO8eAfC80CnCvSjSl0bkRM24X6/XBBEyj0v1nRUQ1LyOy3dbqOWXw==", + "license": "MIT" + }, + "node_modules/koa-convert": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/koa-convert/-/koa-convert-1.2.0.tgz", + "integrity": "sha512-K9XqjmEDStGX09v3oxR7t5uPRy0jqJdvodHa6wxWTHrTfDq0WUNnYTOOUZN6g8OM8oZQXprQASbiIXG2Ez8ehA==", + "license": "MIT", + "dependencies": { + "co": "^4.6.0", + "koa-compose": "^3.0.0" + }, + "engines": { + "node": ">= 4" + } + }, + "node_modules/koa-convert/node_modules/koa-compose": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/koa-compose/-/koa-compose-3.2.1.tgz", + "integrity": "sha512-8gen2cvKHIZ35eDEik5WOo8zbVp9t4cP8p4hW4uE55waxolLRexKKrqfCpwhGVppnB40jWeF8bZeTVg99eZgPw==", + "license": "MIT", + "dependencies": { + "any-promise": "^1.1.0" + } + }, + "node_modules/koa-is-json": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/koa-is-json/-/koa-is-json-1.0.0.tgz", + "integrity": "sha512-+97CtHAlWDx0ndt0J8y3P12EWLwTLMXIfMnYDev3wOTwH/RpBGMlfn4bDXlMEg1u73K6XRE9BbUp+5ZAYoRYWw==", + "license": "MIT" + }, + "node_modules/koa-locales": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/koa-locales/-/koa-locales-1.12.0.tgz", + "integrity": "sha512-lalx0OuvdZ39JppTVqHnYKIgJJbByon9xpt5KSKFOL6/VQS+XBMklMX83+fgkCXzsNacynWaN75ihWP2EGsWIQ==", + "license": "MIT", + "dependencies": { + "debug": "^2.6.0", + "humanize-ms": "^1.2.0", + "ini": "^1.3.4", + "object-assign": "^4.1.0" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/koa-locales/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/koa-locales/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/koa-onerror": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/koa-onerror/-/koa-onerror-4.2.0.tgz", + "integrity": "sha512-D15tp5rxevHqqcvOiEDbtQolG6z3NpBNupz3EUZz43pjYv5SGMom2Xz1FKM8oTya56+aq+hejPW/iBrNnC/UGQ==", + "license": "MIT", + "dependencies": { + "escape-html": "^1.0.3", + "stream-wormhole": "^1.1.0" + }, + "engines": { + "node": ">= 8.0.0" + } + }, + "node_modules/koa-override": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/koa-override/-/koa-override-3.0.0.tgz", + "integrity": "sha512-w2rWCfapbQUZ8TrRBarj6iwryCTooEcdw9lr1hYC1q4FnaCZcAOhpjB1VpqtbODALVMgY3JGlzLSeYRXc5Ky0Q==", + "license": "MIT", + "dependencies": { + "methods": "^1.1.2" + }, + "engines": { + "node": ">= 8.0.0" + } + }, + "node_modules/koa-range": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/koa-range/-/koa-range-0.3.0.tgz", + "integrity": "sha512-Ich3pCz6RhtbajYXRWjIl6O5wtrLs6kE3nkXc9XmaWe+MysJyZO7K4L3oce1Jpg/iMgCbj+5UCiMm/rqVtcDIg==", + "license": "MIT", + "dependencies": { + "stream-slice": "^0.1.2" + }, + "engines": { + "node": ">=7" + } + }, + "node_modules/koa-send": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/koa-send/-/koa-send-5.0.1.tgz", + "integrity": "sha512-tmcyQ/wXXuxpDxyNXv5yNNkdAMdFRqwtegBXUaowiQzUKqJehttS0x2j0eOZDQAyloAth5w6wwBImnFzkUz3pQ==", + "license": "MIT", + "dependencies": { + "debug": "^4.1.1", + "http-errors": "^1.7.3", + "resolve-path": "^1.4.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/koa-send/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/koa-session": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/koa-session/-/koa-session-6.4.0.tgz", + "integrity": "sha512-h/dxmSOvNEXpHQPRs4TV03TZVFyZIjmYQiTAW5JBFTYBOZ0VdpZ8QEE6Dud75g8z9JNGXi3m++VqRmqToB+c2A==", + "license": "MIT", + "dependencies": { + "crc": "^3.8.0", + "debug": "^4.3.3", + "is-type-of": "^1.2.1", + "uuid": "^8.3.2" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/koa-session/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/koa-session/node_modules/is-type-of": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/is-type-of/-/is-type-of-1.4.0.tgz", + "integrity": "sha512-EddYllaovi5ysMLMEN7yzHEKh8A850cZ7pykrY1aNRQGn/CDjRDE9qEWbIdt7xGEVJmjBXzU/fNnC4ABTm8tEQ==", + "license": "MIT", + "dependencies": { + "core-util-is": "^1.0.2", + "is-class-hotfix": "~0.0.6", + "isstream": "~0.1.2" + } + }, + "node_modules/koa-static": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/koa-static/-/koa-static-5.0.0.tgz", + "integrity": "sha512-UqyYyH5YEXaJrf9S8E23GoJFQZXkBVJ9zYYMPGz919MSX1KuvAcycIuS0ci150HCoPf4XQVhQ84Qf8xRPWxFaQ==", + "license": "MIT", + "dependencies": { + "debug": "^3.1.0", + "koa-send": "^5.0.0" + }, + "engines": { + "node": ">= 7.6.0" + } + }, + "node_modules/koa-static-cache": { + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/koa-static-cache/-/koa-static-cache-5.1.4.tgz", + "integrity": "sha512-abVWOHY6z6qSTvNtapWMAnvHS9SUiUCaQQQubClSAT9ybQPsZ6ioKcRarnownS4fMD0sXQgQ5ey8CYEuwoa1Yg==", + "license": "MIT", + "dependencies": { + "compressible": "^2.0.6", + "debug": "^3.1.0", + "fs-readdir-recursive": "^1.0.0", + "mime-types": "^2.1.8", + "mz": "^2.7.0" + }, + "engines": { + "node": ">= 7.6.0" + } + }, + "node_modules/koa/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/koa/node_modules/koa-convert": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/koa-convert/-/koa-convert-2.0.0.tgz", + "integrity": "sha512-asOvN6bFlSnxewce2e/DK3p4tltyfC4VM7ZwuTuepI7dEQVcvpyFuBcEARu1+Hxg8DIwytce2n7jrZtRlPrARA==", + "license": "MIT", + "dependencies": { + "co": "^4.6.0", + "koa-compose": "^4.1.0" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/koa/node_modules/statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash": { + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.18.1.tgz", + "integrity": "sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==", + "license": "MIT" + }, + "node_modules/lodash.defaults": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz", + "integrity": "sha512-qjxPLHd3r5DnsdGacqOMU6pb/avJzdh9tFX2ymgoZE27BmjXrNy/y4LoaiTeAb+O3gL8AfpJGtqfX/ae2leYYQ==", + "license": "MIT" + }, + "node_modules/lodash.flatten": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz", + "integrity": "sha512-C5N2Z3DgnnKr0LOpv/hKCgKdb7ZZwafIrsesve6lmzvZIRZRGaZ/l6Q8+2W7NaT+ZwO3fFlSCzCzrDCFdJfZ4g==", + "license": "MIT" + }, + "node_modules/lodash.includes": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", + "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==", + "license": "MIT" + }, + "node_modules/lodash.isarguments": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", + "integrity": "sha512-chi4NHZlZqZD18a0imDHnZPrDeBbTtVN7GXMwuGdRH9qotxAjYs3aVLKc7zNOG9eddR5Ksd8rvFEBc9SsggPpg==", + "license": "MIT" + }, + "node_modules/lodash.isboolean": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", + "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==", + "license": "MIT" + }, + "node_modules/lodash.isempty": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.isempty/-/lodash.isempty-4.4.0.tgz", + "integrity": "sha512-oKMuF3xEeqDltrGMfDxAPGIVMSSRv8tbRSODbrs4KGsRRLEhrW8N8Rd4DRgB2+621hY8A8XwwrTVhXWpxFvMzg==", + "dev": true, + "license": "MIT" + }, + "node_modules/lodash.isfunction": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/lodash.isfunction/-/lodash.isfunction-3.0.9.tgz", + "integrity": "sha512-AirXNj15uRIMMPihnkInB4i3NHeb4iBtNg9WRWuK2o31S+ePwwNmDPaTL3o7dTJ+VXNZim7rFs4rxN4YU1oUJw==", + "dev": true, + "license": "MIT" + }, + "node_modules/lodash.isinteger": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", + "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==", + "license": "MIT" + }, + "node_modules/lodash.isnumber": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", + "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==", + "license": "MIT" + }, + "node_modules/lodash.isobject": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/lodash.isobject/-/lodash.isobject-3.0.2.tgz", + "integrity": "sha512-3/Qptq2vr7WeJbB4KHUSKlq8Pl7ASXi3UG6CMbBm8WRtXi8+GHm7mKaU3urfpSEzWe2wCIChs6/sdocUsTKJiA==", + "dev": true, + "license": "MIT" + }, + "node_modules/lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==", + "license": "MIT" + }, + "node_modules/lodash.isstring": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==", + "license": "MIT" + }, + "node_modules/lodash.once": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", + "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==", + "license": "MIT" + }, + "node_modules/log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-symbols/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/log-symbols/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/log-symbols/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/log-symbols/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/log-symbols/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/log-symbols/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/long": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", + "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==", + "license": "Apache-2.0" + }, + "node_modules/loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, + "node_modules/lower-case": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", + "integrity": "sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==", + "license": "MIT", + "dependencies": { + "tslib": "^2.0.3" + } + }, + "node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/lru.min": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/lru.min/-/lru.min-1.1.5.tgz", + "integrity": "sha512-5J9ysMYUpYIg9RF2vJpy9SinEmSviFSe0GyPpCQ4L5QSkLAgeLXlTAOu2ZwWUU5m+0SBl6gUU1R1ZQB3aKypfA==", + "license": "MIT", + "engines": { + "bun": ">=1.0.0", + "deno": ">=1.30.0", + "node": ">=8.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wellwelwel" + } + }, + "node_modules/make-dir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", + "dev": true, + "license": "MIT", + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/make-dir/node_modules/semver": { + "version": "7.8.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", + "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true, + "license": "ISC" + }, + "node_modules/map-stream": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.1.0.tgz", + "integrity": "sha512-CkYQrPYZfWnu/DAmVCpTSX/xHpKZ80eKh2lAkyA6AJTef6bW+6JpbQZN5rofum7da+SyN1bi5ctTm+lTfcCW3g==" + }, + "node_modules/matcher": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/matcher/-/matcher-4.0.0.tgz", + "integrity": "sha512-S6x5wmcDmsDRRU/c2dkccDwQPXoFczc5+HpQ2lON8pnvHlnvHAHj5WlLVvw6n6vNyHuVugYrFohYxbS+pvFpKQ==", + "license": "MIT", + "dependencies": { + "escape-string-regexp": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/matcher/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/merge-descriptors": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true, + "license": "MIT" + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "license": "MIT", + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mime": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz", + "integrity": "sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==", + "license": "MIT", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/mime-db": { + "version": "1.54.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz", + "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types/node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/minimatch": { + "version": "5.1.9", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.9.tgz", + "integrity": "sha512-7o1wEA2RyMP7Iu7GNba9vc0RWWGACJOCZBJX2GJWip0ikV+wcOsgVuY9uE8CPiyQhkGFSlhuSkZPavN7u1c2Fw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/minipass": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz", + "integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==", + "dev": true, + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "license": "MIT", + "dependencies": { + "minimist": "^1.2.6" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "node_modules/mm": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/mm/-/mm-3.4.0.tgz", + "integrity": "sha512-pXyBKWM0cMG0QD5NoXCUZok8XOhqe/Pf4ILOYFJ4Ur2RIHJni6YHdxt/zHOiwjf2FAMQH2fowczaQMtIDvq+bw==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-type-of": "^1.2.1", + "muk-prop": "^1.2.1", + "thenify": "^3.3.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/mm/node_modules/is-type-of": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/is-type-of/-/is-type-of-1.4.0.tgz", + "integrity": "sha512-EddYllaovi5ysMLMEN7yzHEKh8A850cZ7pykrY1aNRQGn/CDjRDE9qEWbIdt7xGEVJmjBXzU/fNnC4ABTm8tEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "core-util-is": "^1.0.2", + "is-class-hotfix": "~0.0.6", + "isstream": "~0.1.2" + } + }, + "node_modules/mocha": { + "version": "10.8.2", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.8.2.tgz", + "integrity": "sha512-VZlYo/WE8t1tstuRmqgeyBgCbJc/lEdopaa+axcKzTBJ+UIdlAB9XnmvTCAH4pwR4ElNInaedhEBmZD8iCSVEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-colors": "^4.1.3", + "browser-stdout": "^1.3.1", + "chokidar": "^3.5.3", + "debug": "^4.3.5", + "diff": "^5.2.0", + "escape-string-regexp": "^4.0.0", + "find-up": "^5.0.0", + "glob": "^8.1.0", + "he": "^1.2.0", + "js-yaml": "^4.1.0", + "log-symbols": "^4.1.0", + "minimatch": "^5.1.6", + "ms": "^2.1.3", + "serialize-javascript": "^6.0.2", + "strip-json-comments": "^3.1.1", + "supports-color": "^8.1.1", + "workerpool": "^6.5.1", + "yargs": "^16.2.0", + "yargs-parser": "^20.2.9", + "yargs-unparser": "^2.0.0" + }, + "bin": { + "_mocha": "bin/_mocha", + "mocha": "bin/mocha.js" + }, + "engines": { + "node": ">= 14.0.0" + } + }, + "node_modules/mocha/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/mocha/node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/mocha/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/mocha/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/mocha/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/mocha/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mocha/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/mocha/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/mocha/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/mocha/node_modules/yargs": { + "version": "16.2.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.2.tgz", + "integrity": "sha512-Nt9ZJjXTv5R8MHbqby/wXQ6Gi0Bb3TcYZkR1bzuL4yB2OxWPkXknz513gEF0GoA6tn00UpbPvERW8rzCuWCA6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/mocha/node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/mochawesome-report-generator": { + "version": "6.3.2", + "resolved": "https://registry.npmjs.org/mochawesome-report-generator/-/mochawesome-report-generator-6.3.2.tgz", + "integrity": "sha512-iB6iyOUMyMr8XOUYTNfrqYuZQLZka3K/Gr2GPc6CHPe7t2ZhxxfcoVkpMLOtyDKnWbY1zgu1/7VNRsigrvKnOQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.1.2", + "dateformat": "^4.5.1", + "escape-html": "^1.0.3", + "fs-extra": "^10.0.0", + "fsu": "^1.1.1", + "lodash.isfunction": "^3.0.9", + "opener": "^1.5.2", + "prop-types": "^15.7.2", + "tcomb": "^3.2.17", + "tcomb-validation": "^3.3.0", + "yargs": "^17.2.1" + }, + "bin": { + "marge": "bin/cli.js" + } + }, + "node_modules/mochawesome-report-generator/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/mochawesome-report-generator/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/mochawesome-report-generator/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/mochawesome-report-generator/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/mochawesome-report-generator/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/mochawesome-report-generator/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/mochawesome-with-mocha": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/mochawesome-with-mocha/-/mochawesome-with-mocha-7.1.3.tgz", + "integrity": "sha512-C7df5V1hy2nvAlX7Z7H2YjvvFPUCyyqaK39JdSTK+owpfiTz2OjhGGpraAMW+DgimGbd3uLPn1RW62Ow5T7ZZw==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.1.2", + "diff": "^5.0.0", + "json-stringify-safe": "^5.0.1", + "lodash.isempty": "^4.4.0", + "lodash.isfunction": "^3.0.9", + "lodash.isobject": "^3.0.2", + "lodash.isstring": "^4.0.1", + "mocha": "^10.2.0", + "mochawesome-report-generator": "^6.2.0", + "strip-ansi": "^6.0.1", + "uuid": "^8.3.2" + } + }, + "node_modules/mochawesome-with-mocha/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/mochawesome-with-mocha/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/mochawesome-with-mocha/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/mochawesome-with-mocha/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/mochawesome-with-mocha/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/mochawesome-with-mocha/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/moment": { + "version": "2.31.0", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.31.0.tgz", + "integrity": "sha512-0acOTfMiWOheYS4eoWb80yYMb/JLvVv9SHbs2PehaDzfUG0Bw855SKyk0IKTnPGa5+U2bmi3W68l1+sGLX/pvw==", + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/moment-timezone": { + "version": "0.5.48", + "resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.48.tgz", + "integrity": "sha512-f22b8LV1gbTO2ms2j2z13MuPogNoh5UzxL3nzNAYKGraILnbGc9NEE6dyiiiLv46DGRb8A4kg8UKWLjPthxBHw==", + "license": "MIT", + "dependencies": { + "moment": "^2.29.4" + }, + "engines": { + "node": "*" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/muk-prop": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/muk-prop/-/muk-prop-1.2.1.tgz", + "integrity": "sha512-NdkOVav3GoIkBZqMUneU435HW0a90zitpuO1erPRhOQdPtl65dXD3G9/1k46G6/0ZMau4CJFFUHkMKVsyNZT+w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/multimatch": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-5.0.0.tgz", + "integrity": "sha512-ypMKuglUrZUD99Tk2bUQ+xNQj43lPEfAeX2o9cTteAmShXy2VHDJpuwu1o0xqoKCt9jLVAvwyFKdLTPXKAfJyA==", + "license": "MIT", + "dependencies": { + "@types/minimatch": "^3.0.3", + "array-differ": "^3.0.0", + "array-union": "^2.1.0", + "arrify": "^2.0.1", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/multimatch/node_modules/brace-expansion": { + "version": "1.1.21", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.21.tgz", + "integrity": "sha512-9zeA+KLZNNzglF2TPKRQEDyx6Yby7daAkuy8MiPzpXPsYDWi/DRM8jmwUDxokQjYqBpv5DgPiwD4h4ZZSy1Ujw==", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/multimatch/node_modules/minimatch": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/mustache": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/mustache/-/mustache-2.3.2.tgz", + "integrity": "sha512-KpMNwdQsYz3O/SBS1qJ/o3sqUJ5wSb8gb0pul8CO0S56b9Y2ALm8zCfsjPXsqGFfoNBkDwZuZIAjhsZI03gYVQ==", + "license": "MIT", + "bin": { + "mustache": "bin/mustache" + }, + "engines": { + "npm": ">=1.4.0" + } + }, + "node_modules/mute-stream": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", + "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", + "dev": true, + "license": "ISC" + }, + "node_modules/mysql2": { + "version": "3.24.6", + "resolved": "https://registry.npmjs.org/mysql2/-/mysql2-3.24.6.tgz", + "integrity": "sha512-enu73KhbAua2L3dIxjc6qg6ZJ7H3pt1BImZASWNWY5xSsmJ1ZuUPULTDGXgmJbI61vb+nJAG19IZclIq19UidQ==", + "license": "MIT", + "dependencies": { + "aws-ssl-profiles": "^1.1.2", + "generate-function": "^2.3.1", + "iconv-lite": "^0.7.3", + "long": "^5.3.2", + "lru.min": "^1.1.4", + "named-placeholders": "^1.1.6", + "sql-escaper": "^1.5.1" + }, + "engines": { + "node": ">= 8.0" + }, + "peerDependencies": { + "@types/node": ">= 8" + } + }, + "node_modules/mysql2/node_modules/iconv-lite": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.3.tgz", + "integrity": "sha512-IKXpvIzjnC9XTAUbVBcMfGS0EPaIXtW6v+zr+RRp+hqULEpo0owZax6wyRwPOJbWbzjYspQwusTsfVr0ifh4uQ==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/mysql2/node_modules/long": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/long/-/long-5.3.2.tgz", + "integrity": "sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA==", + "license": "Apache-2.0" + }, + "node_modules/mz": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", + "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", + "license": "MIT", + "dependencies": { + "any-promise": "^1.0.0", + "object-assign": "^4.0.1", + "thenify-all": "^1.0.0" + } + }, + "node_modules/mz-modules": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mz-modules/-/mz-modules-2.1.0.tgz", + "integrity": "sha512-sjk8lcRW3vrVYnZ+W+67L/2rL+jbO5K/N6PFGIcLWTiYytNr22Ah9FDXFs+AQntTM1boZcoHi5qS+CV1seuPog==", + "license": "MIT", + "dependencies": { + "glob": "^7.1.2", + "ko-sleep": "^1.0.3", + "mkdirp": "^0.5.1", + "pump": "^3.0.0", + "rimraf": "^2.6.1" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/mz-modules/node_modules/brace-expansion": { + "version": "1.1.21", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.21.tgz", + "integrity": "sha512-9zeA+KLZNNzglF2TPKRQEDyx6Yby7daAkuy8MiPzpXPsYDWi/DRM8jmwUDxokQjYqBpv5DgPiwD4h4ZZSy1Ujw==", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/mz-modules/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/mz-modules/node_modules/minimatch": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/named-placeholders": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/named-placeholders/-/named-placeholders-1.1.6.tgz", + "integrity": "sha512-Tz09sEL2EEuv5fFowm419c1+a/jSMiBjI9gHxVLrVdbUkkNUUfjsVYs9pVZu5oCon/kmRh9TfLEObFtkVxmY0w==", + "license": "MIT", + "dependencies": { + "lru.min": "^1.1.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/nanoid": { + "version": "3.3.20", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.20.tgz", + "integrity": "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==", + "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/ndir": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/ndir/-/ndir-0.1.5.tgz", + "integrity": "sha512-GEdViSiVHi63HASUGaQXNBbUNe5KDnuAYvOGBlY7y+CCCRT3NBeMWQlODb2GVV2cKwEIwHzo9KOCMsPBXlKsOg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/no-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz", + "integrity": "sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==", + "license": "MIT", + "dependencies": { + "lower-case": "^2.0.2", + "tslib": "^2.0.3" + } + }, + "node_modules/node-domexception": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", + "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", + "deprecated": "Use your platform's native DOMException instead", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "github", + "url": "https://paypal.me/jimmywarting" + } + ], + "license": "MIT", + "engines": { + "node": ">=10.5.0" + } + }, + "node_modules/node-hex": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/node-hex/-/node-hex-1.0.1.tgz", + "integrity": "sha512-iwpZdvW6Umz12ICmu9IYPRxg0tOLGmU3Tq2tKetejCj3oZd7b2nUXwP3a7QA5M9glWy8wlPS1G3RwM/CdsUbdQ==", + "license": "MIT", + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/node-homedir": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/node-homedir/-/node-homedir-1.1.1.tgz", + "integrity": "sha512-Xsmf94D/DdeDISAECUaxXVxhh+kHdbOQE4CnP4igo3HXL3BSmmUpD5M7orH434EZZwBTFF2xe5SgsQr/wOBuNw==", + "license": "MIT", + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/nodemailer": { + "version": "10.1.2", + "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-10.1.2.tgz", + "integrity": "sha512-rnQn9Rzh8RAwcp42MVsIvxbsv6YZ2a2/av+uyJ/LPU1+2QSlrRgFsWWZTKenyRUqkIl8urOI0c4+CEcmFdsvQw==", + "license": "MIT-0", + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/npm-run-path/node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "license": "MIT", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/onelogger": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/onelogger/-/onelogger-1.0.1.tgz", + "integrity": "sha512-CssDwyG8cnY8fGm9HJurr2LNScfn2u//hnxgivLMgTj+B/S2IspJbbxgFboaRJ+V0CPzi59wqTLuikMcXyVeaw==", + "license": "MIT", + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/only": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/only/-/only-0.0.2.tgz", + "integrity": "sha512-Fvw+Jemq5fjjyWz6CpKx6w9s7xxqo3+JCyM0WXWeCSOboZ8ABkyvP8ID4CZuChA/wxSx+XSJmdOm8rGVyJ1hdQ==" + }, + "node_modules/opener": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/opener/-/opener-1.5.2.tgz", + "integrity": "sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A==", + "dev": true, + "license": "(WTFPL OR MIT)", + "bin": { + "opener": "bin/opener-bin.js" + } + }, + "node_modules/ora": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", + "integrity": "sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "bl": "^4.1.0", + "chalk": "^4.1.0", + "cli-cursor": "^3.1.0", + "cli-spinners": "^2.5.0", + "is-interactive": "^1.0.0", + "is-unicode-supported": "^0.1.0", + "log-symbols": "^4.1.0", + "strip-ansi": "^6.0.0", + "wcwidth": "^1.0.1" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ora/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/ora/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/ora/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/ora/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/ora/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ora/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/os-name": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/os-name/-/os-name-1.0.3.tgz", + "integrity": "sha512-f5estLO2KN8vgtTRaILIgEGBoBrMnZ3JQ7W9TMZCnOIGwHe8TRGSpcagnWDo+Dfhd/z08k9Xe75hvciJJ8Qaew==", + "license": "MIT", + "dependencies": { + "osx-release": "^1.0.0", + "win-release": "^1.0.0" + }, + "bin": { + "os-name": "cli.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/osx-release": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/osx-release/-/osx-release-1.1.0.tgz", + "integrity": "sha512-ixCMMwnVxyHFQLQnINhmIpWqXIfS2YOXchwQrk+OFzmo6nDjQ0E4KXAyyUh0T0MZgV4bUhkRrAbVqlE4yLVq4A==", + "license": "MIT", + "dependencies": { + "minimist": "^1.1.0" + }, + "bin": { + "osx-release": "cli.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-map": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", + "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/p-timeout": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-4.1.0.tgz", + "integrity": "sha512-+/wmHtzJuWii1sXn3HCuH/FTwGhrp4tmJTxSKJbfS+vkipci6osxXM5mY0jUiRzWKMTgUT8l7HFbeSwZAynqHw==", + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/package-json-from-dist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", + "dev": true, + "license": "BlueOak-1.0.0" + }, + "node_modules/param-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/param-case/-/param-case-3.0.4.tgz", + "integrity": "sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A==", + "license": "MIT", + "dependencies": { + "dot-case": "^3.0.4", + "tslib": "^2.0.3" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/pascal-case": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/pascal-case/-/pascal-case-3.1.2.tgz", + "integrity": "sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g==", + "license": "MIT", + "dependencies": { + "no-case": "^3.0.4", + "tslib": "^2.0.3" + } + }, + "node_modules/path-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/path-case/-/path-case-3.0.4.tgz", + "integrity": "sha512-qO4qCFjXqVTrcbPt/hQfhTQ+VhFsqNKOPtytgNKkKxSoEp3XPUQ8ObFuePylOIok5gjn69ry8XiULxCwot3Wfg==", + "license": "MIT", + "dependencies": { + "dot-case": "^3.0.4", + "tslib": "^2.0.3" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/path-to-regexp": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.9.0.tgz", + "integrity": "sha512-xIp7/apCFJuUHdDLWe8O1HIkb0kQrOMb/0u6FXQjemHn/ii5LrIzU6bdECnsiTF/GjZkMEKg1xdiZwNqDYlZ6g==", + "license": "MIT", + "dependencies": { + "isarray": "0.0.1" + } + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/pause-stream": { + "version": "0.0.11", + "resolved": "https://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz", + "integrity": "sha512-e3FBlXLmN/D1S+zHzanP4E/4Z60oFAa3O051qt1pxa7DEJWKAyil6upYVXCWadEnuoqa4Pkc9oUx9zsxYeRv8A==", + "license": [ + "MIT", + "Apache2" + ], + "dependencies": { + "through": "~2.3" + } + }, + "node_modules/pg-connection-string": { + "version": "2.14.1", + "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.14.1.tgz", + "integrity": "sha512-qR3kGNPBLpCNtz0evbKA0Y/MRFXwSSdT+pTJvYp/bXTcReZbvX1kzF0IyTc1QnxqF7AZbOeBhNL8R5mYQZV/MA==", + "license": "MIT" + }, + "node_modules/picomatch": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", + "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pkg-up": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/pkg-up/-/pkg-up-3.1.0.tgz", + "integrity": "sha512-nDywThFk1i4BQK4twPQ6TA4RT8bDY96yeuCVBWL3ePARCiEKDRSrNGbFIgUJpLp+XeIR65v8ra7WuJOFUBtkMA==", + "dev": true, + "license": "MIT", + "dependencies": { + "find-up": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pkg-up/node_modules/find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/pkg-up/node_modules/locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/pkg-up/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/pkg-up/node_modules/p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/pkg-up/node_modules/path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/platform": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/platform/-/platform-1.3.6.tgz", + "integrity": "sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg==", + "license": "MIT" + }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "license": "MIT" + }, + "node_modules/prop-types": { + "version": "15.8.1", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", + "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", + "dev": true, + "license": "MIT", + "dependencies": { + "loose-envify": "^1.4.0", + "object-assign": "^4.1.1", + "react-is": "^16.13.1" + } + }, + "node_modules/ps-tree": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/ps-tree/-/ps-tree-1.2.0.tgz", + "integrity": "sha512-0VnamPPYHl4uaU/nSFeZZpR21QAWRz+sRv4iW9+v/GS/J5U5iZB5BNN6J0RMoOvdx2gWM2+ZFMIm58q24e4UYA==", + "license": "MIT", + "dependencies": { + "event-stream": "=3.3.4" + }, + "bin": { + "ps-tree": "bin/ps-tree.js" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/pump": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.4.tgz", + "integrity": "sha512-VS7sjc6KR7e1ukRFhQSY5LM2uBWAUPiOPa/A3mkKmiMwSmRFUITt0xuj+/lesgnCv+dPIEYlkzrcyXgquIHMcA==", + "license": "MIT", + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/pumpify": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz", + "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", + "license": "MIT", + "dependencies": { + "duplexify": "^3.6.0", + "inherits": "^2.0.3", + "pump": "^2.0.0" + } + }, + "node_modules/pumpify/node_modules/pump": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", + "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", + "license": "MIT", + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/qrcode-generator": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/qrcode-generator/-/qrcode-generator-2.0.4.tgz", + "integrity": "sha512-mZSiP6RnbHl4xL2Ap5HfkjLnmxfKcPWpWe/c+5XxCuetEenqmNFf1FH/ftXPCtFG5/TDobjsjz6sSNL0Sr8Z9g==", + "license": "MIT" + }, + "node_modules/qs": { + "version": "6.16.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.16.1.tgz", + "integrity": "sha512-5Px6J7rfHBAGUhNQ3es4YzcOdBBw0SDcVtThJml4RdnKw4tKs2epA0kPZ+K8X+WiHktT93RHVcQ/3ym5aTCgtg==", + "license": "BSD-3-Clause", + "dependencies": { + "es-define-property": "^1.0.1", + "side-channel": "^1.1.1" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/random-bytes": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/random-bytes/-/random-bytes-1.0.0.tgz", + "integrity": "sha512-iv7LhNVO047HzYR3InF6pUcUsPQiHTM1Qal51DcGSuZFBil1aBBWG5eHPNek7bvILMaYJ/8RU1e8w1AMdHmLQQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "node_modules/raw-body": { + "version": "2.5.3", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.3.tgz", + "integrity": "sha512-s4VSOf6yN0rvbRZGxs8Om5CWj6seneMwK3oDb4lWDH0UPhWcxwOWw5+qk24bxq87szX1ydrwylIOp2uG1ojUpA==", + "license": "MIT", + "dependencies": { + "bytes": "~3.1.2", + "http-errors": "~2.0.1", + "iconv-lite": "~0.4.24", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/raw-body/node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/raw-body/node_modules/http-errors": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz", + "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==", + "license": "MIT", + "dependencies": { + "depd": "~2.0.0", + "inherits": "~2.0.4", + "setprototypeof": "~1.2.0", + "statuses": "~2.0.2", + "toidentifier": "~1.0.1" + }, + "engines": { + "node": ">= 0.8" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/raw-body/node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dev": true, + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/ready-callback": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ready-callback/-/ready-callback-3.0.0.tgz", + "integrity": "sha512-wGhjJMrxVEX35Ec+QlM2FW+ZsXhThNCbmdk+x22vzwRPPsDUNgq7C6nU0EpJRvNJSK/MiwQ73XZljo/IKhovXA==", + "license": "MIT", + "dependencies": { + "debug": "^4.3.4", + "get-ready": "^2.0.1", + "once": "^1.4.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/ready-callback/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/redis-errors": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/redis-errors/-/redis-errors-1.2.0.tgz", + "integrity": "sha512-1qny3OExCf0UvUV/5wpYKf2YwPcOqXzkwKKSmKHiE6ZMQs5heeE/c8eXK+PNllPvmjgAbfnsbpkGZWy8cBpn9w==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/redis-parser": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/redis-parser/-/redis-parser-3.0.0.tgz", + "integrity": "sha512-DJnGAeenTdpMEH6uAJRK/uiyEIH9WVsUmoLwzudwGJUwZPp80PDBWPHXSAGNPwNvIXAbe7MSUB1zQFugFml66A==", + "license": "MIT", + "dependencies": { + "redis-errors": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/reduce-flatten": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/reduce-flatten/-/reduce-flatten-2.0.0.tgz", + "integrity": "sha512-EJ4UNY/U1t2P/2k6oqotuX2Cc3T6nxJwsM0N0asT7dhrtH1ltUxDn4NalSYmPE2rCkVpcf/X6R0wDwcFpzhd4w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/reflect-metadata": { + "version": "0.1.14", + "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.14.tgz", + "integrity": "sha512-ZhYeb6nRaXCfhnndflDK8qI6ZQ/YcWZCISRAWICW9XYqMUwjZM9Z0DveWX/ABN01oxSHwVxKQmxeYZSsm0jh5A==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "license": "ISC" + }, + "node_modules/requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", + "license": "MIT" + }, + "node_modules/resolve-path": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/resolve-path/-/resolve-path-1.4.0.tgz", + "integrity": "sha512-i1xevIst/Qa+nA9olDxLWnLk8YZbi8R/7JPbCMcgyWaFR6bKWaexgJgEB5oc2PKMjYdrHynyz0NY+if+H98t1w==", + "license": "MIT", + "dependencies": { + "http-errors": "~1.6.2", + "path-is-absolute": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/resolve-path/node_modules/depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/resolve-path/node_modules/http-errors": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", + "integrity": "sha512-lks+lVC8dgGyh97jxvxeYTWQFvh4uw4yC12gVl63Cg30sjPX4wuGcdkICVXDAESr6OJGjqGA8Iz5mkeN6zlD7A==", + "license": "MIT", + "dependencies": { + "depd": "~1.1.2", + "inherits": "2.0.3", + "setprototypeof": "1.1.0", + "statuses": ">= 1.4.0 < 2" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/resolve-path/node_modules/inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw==", + "license": "ISC" + }, + "node_modules/resolve-path/node_modules/setprototypeof": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", + "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==", + "license": "ISC" + }, + "node_modules/resolve-path/node_modules/statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/restore-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/restore-cursor/node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/retry-as-promised": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/retry-as-promised/-/retry-as-promised-7.1.1.tgz", + "integrity": "sha512-hMD7odLOt3LkTjcif8aRZqi/hybjpLNgSk5oF5FCowfCjok6LukpN2bDX7R5wDmbgBQFn7YoBxSagmtXHaJYJw==", + "license": "MIT" + }, + "node_modules/reusify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", + "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", + "license": "MIT", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "license": "ISC", + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + } + }, + "node_modules/rimraf/node_modules/brace-expansion": { + "version": "1.1.21", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.21.tgz", + "integrity": "sha512-9zeA+KLZNNzglF2TPKRQEDyx6Yby7daAkuy8MiPzpXPsYDWi/DRM8jmwUDxokQjYqBpv5DgPiwD4h4ZZSy1Ujw==", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/rimraf/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rimraf/node_modules/minimatch": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/rndm": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/rndm/-/rndm-1.2.0.tgz", + "integrity": "sha512-fJhQQI5tLrQvYIYFpOnFinzv9dwmR7hRnUz1XqP3OJ1jIweTNOd6aTO4jwQSgcBSFUB+/KHJxuGneime+FdzOw==", + "license": "MIT" + }, + "node_modules/run-async": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", + "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/runscript": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/runscript/-/runscript-2.0.1.tgz", + "integrity": "sha512-CjlpKusSKpE943TsCLkqU1dBDfC2nWwaaiaVlXu3IG3FvSa4IqSn7dMGT16Q6wDNUJX/51IO4mifbEipXnMKDA==", + "license": "MIT", + "dependencies": { + "is-type-of": "^2.2.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/rxjs": { + "version": "7.8.2", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz", + "integrity": "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.1.0" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/safe-regex-test": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.1.0.tgz", + "integrity": "sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "is-regex": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/safe-timers": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-timers/-/safe-timers-1.1.0.tgz", + "integrity": "sha512-9aqY+v5eMvmRaluUEtdRThV1EjlSElzO7HuCj0sTW9xvp++8iJ9t/RWGNWV6/WHcUJLHpyT2SNf/apoKTU2EpA==", + "license": "MIT" + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "license": "MIT" + }, + "node_modules/scmp": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/scmp/-/scmp-2.1.0.tgz", + "integrity": "sha512-o/mRQGk9Rcer/jEEw/yw4mwo3EU/NvYvp577/Btqrym9Qy5/MdWGBqipbALgd2lrdWTJ5/gqDusxfnQBxOxT2Q==", + "deprecated": "Just use Node.js's crypto.timingSafeEqual()", + "license": "BSD-3-Clause" + }, + "node_modules/sdk-base": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/sdk-base/-/sdk-base-4.2.1.tgz", + "integrity": "sha512-B33iy/AkIpLyxexn/5v+8jmYHCyUaJizEQcmhvMY+SoiXViY1FEULbQibQH/EcOfzPwJqJ5UDeXyUJGO47Sq3g==", + "license": "MIT", + "dependencies": { + "await-event": "^2.1.0", + "await-first": "^1.0.0", + "co": "^4.6.0", + "p-timeout": "^4.1.0" + } + }, + "node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "license": "ISC", + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/sendmessage": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/sendmessage/-/sendmessage-2.0.0.tgz", + "integrity": "sha512-//UAqD/jhpCAQd4zRJ8KRv5FoaM2jeT94p+C2DlR0yGXZyjJTIQnl/fG7KpLo+x6tH+1SglUUh88C6LOxtaZbA==", + "license": "MIT", + "engines": { + "node": ">= 14.17.0" + } + }, + "node_modules/sentence-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/sentence-case/-/sentence-case-3.0.4.tgz", + "integrity": "sha512-8LS0JInaQMCRoQ7YUytAo/xUu5W2XnQxV2HI/6uM6U7CITS1RqPElr30V6uIqyMKM9lJGRVFy5/4CuzcixNYSg==", + "license": "MIT", + "dependencies": { + "no-case": "^3.0.4", + "tslib": "^2.0.3", + "upper-case-first": "^2.0.2" + } + }, + "node_modules/sequelize": { + "version": "6.37.8", + "resolved": "https://registry.npmjs.org/sequelize/-/sequelize-6.37.8.tgz", + "integrity": "sha512-HJ0IQFqcTsTiqbEgiuioYFMSD00TP6Cz7zoTti+zVVBwVe9fEhev9cH6WnM3XU31+ABS356durAb99ZuOthnKw==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/sequelize" + } + ], + "license": "MIT", + "dependencies": { + "@types/debug": "^4.1.8", + "@types/validator": "^13.7.17", + "debug": "^4.3.4", + "dottie": "^2.0.6", + "inflection": "^1.13.4", + "lodash": "^4.17.21", + "moment": "^2.29.4", + "moment-timezone": "^0.5.43", + "pg-connection-string": "^2.6.1", + "retry-as-promised": "^7.0.4", + "semver": "^7.5.4", + "sequelize-pool": "^7.1.0", + "toposort-class": "^1.0.1", + "uuid": "^8.3.2", + "validator": "^13.9.0", + "wkx": "^0.5.0" + }, + "engines": { + "node": ">=10.0.0" + }, + "peerDependenciesMeta": { + "ibm_db": { + "optional": true + }, + "mariadb": { + "optional": true + }, + "mysql2": { + "optional": true + }, + "oracledb": { + "optional": true + }, + "pg": { + "optional": true + }, + "pg-hstore": { + "optional": true + }, + "snowflake-sdk": { + "optional": true + }, + "sqlite3": { + "optional": true + }, + "tedious": { + "optional": true + } + } + }, + "node_modules/sequelize-pool": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/sequelize-pool/-/sequelize-pool-7.1.0.tgz", + "integrity": "sha512-G9c0qlIWQSK29pR/5U2JF5dDQeqqHRragoyahj/Nx4KOOQ3CPPfzxnfqFPCSB7x5UgjOgnZ61nSxz+fjDpRlJg==", + "license": "MIT", + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/sequelize/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/sequelize/node_modules/semver": { + "version": "7.8.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", + "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/serialize-javascript": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", + "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "randombytes": "^2.1.0" + } + }, + "node_modules/serialize-json": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/serialize-json/-/serialize-json-1.0.3.tgz", + "integrity": "sha512-TJvXOXSUEH4Lh2FNy1mYzNkUyBG7Ti5fRKGAbcpaDX3mLq23aT/5unC+cIFc5JTDi4/BHTaYLhynrboCCYrFaQ==", + "license": "MIT", + "dependencies": { + "debug": "^3.2.6", + "is-type-of": "^1.2.1", + "utility": "^1.15.0" + }, + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/serialize-json/node_modules/is-type-of": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/is-type-of/-/is-type-of-1.4.0.tgz", + "integrity": "sha512-EddYllaovi5ysMLMEN7yzHEKh8A850cZ7pykrY1aNRQGn/CDjRDE9qEWbIdt7xGEVJmjBXzU/fNnC4ABTm8tEQ==", + "license": "MIT", + "dependencies": { + "core-util-is": "^1.0.2", + "is-class-hotfix": "~0.0.6", + "isstream": "~0.1.2" + } + }, + "node_modules/serialize-json/node_modules/utility": { + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/utility/-/utility-1.18.0.tgz", + "integrity": "sha512-PYxZDA+6QtvRvm//++aGdmKG/cI07jNwbROz0Ql+VzFV1+Z0Dy55NI4zZ7RHc9KKpBePNFwoErqIuqQv/cjiTA==", + "license": "MIT", + "dependencies": { + "copy-to": "^2.0.1", + "escape-html": "^1.0.3", + "mkdirp": "^0.5.1", + "mz": "^2.7.0", + "unescape": "^1.0.1" + }, + "engines": { + "node": ">= 0.12.0" + } + }, + "node_modules/set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", + "license": "ISC" + }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "license": "ISC" + }, + "node_modules/shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/should-send-same-site-none": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/should-send-same-site-none/-/should-send-same-site-none-2.0.5.tgz", + "integrity": "sha512-7dig49H7sKnv1v/GPoFQChGgJdEX9s2oy9TQBSD5RbUx7M9CCRjHMaFP06v+DZQNM0K+o8dBhvBAd4eEKirqbQ==", + "license": "MIT" + }, + "node_modules/side-channel": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.1.tgz", + "integrity": "sha512-6x6dK6zJdpTzF4sQeNYxwtvBzf6Eg4GtlesS94HOvTudUeyK2WXAaIfmDgsyslYrRBeFIlsi54AYsFGUuhmvrQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.4", + "side-channel-list": "^1.0.1", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.1.tgz", + "integrity": "sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/snake-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/snake-case/-/snake-case-3.0.4.tgz", + "integrity": "sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==", + "license": "MIT", + "dependencies": { + "dot-case": "^3.0.4", + "tslib": "^2.0.3" + } + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "license": "MIT", + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/split": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/split/-/split-0.3.3.tgz", + "integrity": "sha512-wD2AeVmxXRBoX44wAycgjVpMhvbwdI2aZjCkvfNcH1YqHQvJVa1duWc73OyVGJUc05fhFaTZeQ/PYsrmyH0JVA==", + "license": "MIT", + "dependencies": { + "through": "2" + }, + "engines": { + "node": "*" + } + }, + "node_modules/split2": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/split2/-/split2-2.2.0.tgz", + "integrity": "sha512-RAb22TG39LhI31MbreBgIuKiIKhVsawfTgEGqKHTK87aG+ul/PB8Sqoi3I7kVdRWiCfrKxK3uo4/YUkpNvhPbw==", + "license": "ISC", + "dependencies": { + "through2": "^2.0.2" + } + }, + "node_modules/sql-escaper": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/sql-escaper/-/sql-escaper-1.5.2.tgz", + "integrity": "sha512-6CKD38c31SENivxOADeMNLdukOnUxUcflKtzVWzace7Riv1v7cAEym5Cx9Q7gYZ3ezIJI7ZpqecQq8cqNeSSFg==", + "license": "MIT", + "engines": { + "bun": ">=1.0.0", + "deno": ">=2.0.0", + "node": ">=12.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/mysqljs/sql-escaper?sponsor=1" + } + }, + "node_modules/stack-trace": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", + "integrity": "sha512-KGzahc7puUKkzyMt+IqAep+TVNbKP+k2Lmwhub39m1AsTSkaDutx56aDCo+HLDzf/D26BIHTJWNiTG1KAJiQCg==", + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/standard-as-callback": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/standard-as-callback/-/standard-as-callback-2.1.0.tgz", + "integrity": "sha512-qoRRSyROncaz1z0mvYqIE4lCd9p2R90i6GxW3uZv5ucSu8tU7B5HXUP1gG8pVZsYNVaXjk8ClXHPttLyxAL48A==", + "license": "MIT" + }, + "node_modules/statuses": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz", + "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/stream-combiner": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.0.4.tgz", + "integrity": "sha512-rT00SPnTVyRsaSz5zgSPma/aHSOic5U1prhYdRy5HS2kTZviFpmDgzilbtsJsxiroqACmayynDN/9VzIbX5DOw==", + "license": "MIT", + "dependencies": { + "duplexer": "~0.1.1" + } + }, + "node_modules/stream-shift": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.3.tgz", + "integrity": "sha512-76ORR0DO1o1hlKwTbi/DM3EXWGf3ZJYO8cXX5RJwnul2DEg2oyoZyjLNoQM8WsvZiFKCRfC1O0J7iCvie3RZmQ==", + "license": "MIT" + }, + "node_modules/stream-slice": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/stream-slice/-/stream-slice-0.1.2.tgz", + "integrity": "sha512-QzQxpoacatkreL6jsxnVb7X5R/pGw9OUv2qWTYWnmLpg4NdN31snPy/f3TdQE1ZUXaThRvj1Zw4/OGg0ZkaLMA==", + "license": "MIT" + }, + "node_modules/stream-wormhole": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/stream-wormhole/-/stream-wormhole-1.1.0.tgz", + "integrity": "sha512-gHFfL3px0Kctd6Po0M8TzEvt3De/xu6cnRrjlfYNhwbhLPLwigI2t1nc6jrzNuaYg5C4YF78PPFuQPzRiqn9ew==", + "license": "MIT", + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/streamsearch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", + "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==", + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/superagent": { + "version": "8.1.2", + "resolved": "https://registry.npmjs.org/superagent/-/superagent-8.1.2.tgz", + "integrity": "sha512-6WTxW1EB6yCxV5VFOIPQruWGHqc3yI7hEmZK6h+pyk69Lk/Ut7rLUY6W/ONF2MjBuGjvmMiIpsrVJ2vjrHlslA==", + "deprecated": "Please upgrade to superagent v10.2.2+, see release notes at https://github.com/forwardemail/superagent/releases/tag/v10.2.2 - maintenance is supported by Forward Email @ https://forwardemail.net", + "dev": true, + "license": "MIT", + "dependencies": { + "component-emitter": "^1.3.0", + "cookiejar": "^2.1.4", + "debug": "^4.3.4", + "fast-safe-stringify": "^2.1.1", + "form-data": "^4.0.0", + "formidable": "^2.1.2", + "methods": "^1.1.2", + "mime": "2.6.0", + "qs": "^6.11.0", + "semver": "^7.3.8" + }, + "engines": { + "node": ">=6.4.0 <13 || >=14" + } + }, + "node_modules/superagent/node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/superagent/node_modules/semver": { + "version": "7.8.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", + "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/supertest": { + "version": "6.3.4", + "resolved": "https://registry.npmjs.org/supertest/-/supertest-6.3.4.tgz", + "integrity": "sha512-erY3HFDG0dPnhw4U+udPfrzXa4xhSG+n4rxfRuZWCUvjFWwKl+OxWf/7zk50s84/fAAs7vf5QAb9uRa0cCykxw==", + "deprecated": "Please upgrade to supertest v7.1.3+, see release notes at https://github.com/forwardemail/supertest/releases/tag/v7.1.3 - maintenance is supported by Forward Email @ https://forwardemail.net", + "dev": true, + "license": "MIT", + "dependencies": { + "methods": "^1.1.2", + "superagent": "^8.1.2" + }, + "engines": { + "node": ">=6.4.0" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/supports-hyperlinks": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-2.3.0.tgz", + "integrity": "sha512-RpsAZlpWcDwOPQA22aCH4J0t7L8JmAvsCxfOSEwm7cQs3LshN36QaTkwd70DnBOXDWGssw2eUoc8CaRWT0XunA==", + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0", + "supports-color": "^7.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-hyperlinks/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-hyperlinks/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/table-layout": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/table-layout/-/table-layout-1.0.2.tgz", + "integrity": "sha512-qd/R7n5rQTRFi+Zf2sk5XVVd9UQl6ZkduPFC3S7WEGJAmetDTjY3qPN50eSKzwuzEyQKy5TN2TiZdkIjos2L6A==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-back": "^4.0.1", + "deep-extend": "~0.6.0", + "typical": "^5.2.0", + "wordwrapjs": "^4.0.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/tcomb": { + "version": "3.2.29", + "resolved": "https://registry.npmjs.org/tcomb/-/tcomb-3.2.29.tgz", + "integrity": "sha512-di2Hd1DB2Zfw6StGv861JoAF5h/uQVu/QJp2g8KVbtfKnoHdBQl5M32YWq6mnSYBQ1vFFrns5B1haWJL7rKaOQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/tcomb-validation": { + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/tcomb-validation/-/tcomb-validation-3.4.1.tgz", + "integrity": "sha512-urVVMQOma4RXwiVCa2nM2eqrAomHROHvWPuj6UkDGz/eb5kcy0x6P0dVt6kzpUZtYMNoAqJLWmz1BPtxrtjtrA==", + "dev": true, + "license": "MIT", + "dependencies": { + "tcomb": "^3.0.0" + } + }, + "node_modules/tcp-base": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/tcp-base/-/tcp-base-3.2.0.tgz", + "integrity": "sha512-fFAqH8QTbheuEbXLdbxTSe31Gkw6Lg3nq4loyrxIXM6+ILGdbYXEblgyuu7UltOkOHbP/q2iqaC+gIXXu0C5bg==", + "license": "MIT", + "dependencies": { + "is-type-of": "^1.0.0", + "sdk-base": "^3.1.1" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/tcp-base/node_modules/is-type-of": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/is-type-of/-/is-type-of-1.4.0.tgz", + "integrity": "sha512-EddYllaovi5ysMLMEN7yzHEKh8A850cZ7pykrY1aNRQGn/CDjRDE9qEWbIdt7xGEVJmjBXzU/fNnC4ABTm8tEQ==", + "license": "MIT", + "dependencies": { + "core-util-is": "^1.0.2", + "is-class-hotfix": "~0.0.6", + "isstream": "~0.1.2" + } + }, + "node_modules/tcp-base/node_modules/sdk-base": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/sdk-base/-/sdk-base-3.6.0.tgz", + "integrity": "sha512-jxHUIrRLlAoRFRwiXKhOGjd6BeFWO/jz7tv+E7lbMSef6F9jzFN2Sv3hLW58oDDKscKaBGG6vQdkbXn7isE7fw==", + "license": "MIT", + "dependencies": { + "await-event": "^2.1.0", + "await-first": "^1.0.0", + "co": "^4.6.0", + "is-type-of": "^1.2.1" + } + }, + "node_modules/terminal-link": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/terminal-link/-/terminal-link-2.1.1.tgz", + "integrity": "sha512-un0FmiRUQNr5PJqy9kP7c40F5BOfpGlYTrxonDChEZB7pzZxRNp/bt+ymiy9/npwXya9KH99nJ/GXFIiUkYGFQ==", + "license": "MIT", + "dependencies": { + "ansi-escapes": "^4.2.1", + "supports-hyperlinks": "^2.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/test-exclude": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-7.0.2.tgz", + "integrity": "sha512-u9E6A+ZDYdp7a4WnarkXPZOx8Ilz46+kby6p1yZ8zsGTz9gYa6FIS7lj2oezzNKmtdyyJNNmmXDppga5GB7kSw==", + "dev": true, + "license": "ISC", + "dependencies": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^10.4.1", + "minimatch": "^10.2.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/test-exclude/node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/test-exclude/node_modules/glob": { + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz", + "integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==", + "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", + "dev": true, + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/test-exclude/node_modules/glob/node_modules/minimatch": { + "version": "9.0.9", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz", + "integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.2" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/test-exclude/node_modules/minimatch": { + "version": "10.2.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz", + "integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "brace-expansion": "^5.0.8" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/test-exclude/node_modules/minimatch/node_modules/brace-expansion": { + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.12.tgz", + "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/thenify": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", + "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", + "license": "MIT", + "dependencies": { + "any-promise": "^1.0.0" + } + }, + "node_modules/thenify-all": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", + "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", + "license": "MIT", + "dependencies": { + "thenify": ">= 3.1.0 < 4" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", + "license": "MIT" + }, + "node_modules/through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "license": "MIT", + "dependencies": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, + "node_modules/through2/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "license": "MIT" + }, + "node_modules/through2/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "license": "MIT", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/through2/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "license": "MIT" + }, + "node_modules/through2/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "license": "MIT", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/toposort-class": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toposort-class/-/toposort-class-1.0.1.tgz", + "integrity": "sha512-OsLcGGbYF3rMjPUf8oKktyvCiUxSbqMMS39m33MAjLTC1DVIH6x3WSt63/M77ihI09+Sdfk1AXvfhCEeUmC7mg==", + "license": "MIT" + }, + "node_modules/ts-node": { + "version": "10.9.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", + "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.1", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-esm": "dist/bin-esm.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", + "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } + } + }, + "node_modules/ts-node/node_modules/diff": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.4.tgz", + "integrity": "sha512-X07nttJQkwkfKfvTPG/KSnE2OMdcUCao6+eXF3wmnIQRn2aPAHH3VxDbDOdegkd6JbPsXqShpvEOHfAT+nCNwQ==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/tsconfig-paths": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-4.2.0.tgz", + "integrity": "sha512-NoZ4roiN7LnbKn9QqE1amc9DJfzvZXxF4xDavcOWt1BPkdx+m+0gJuPM+S0vCe7zTJMYUP0R8pO2XMr+Y8oLIg==", + "license": "MIT", + "dependencies": { + "json5": "^2.2.2", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD" + }, + "node_modules/tsscmp": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/tsscmp/-/tsscmp-1.0.6.tgz", + "integrity": "sha512-LxhtAkPDTkVCMQjt2h6eBVY28KCjikZqZfMcC15YBeNjkgUpdCfBu5HoiOTDu86v6smE8yOjyEktJ8hlbANHQA==", + "license": "MIT", + "engines": { + "node": ">=0.6.x" + } + }, + "node_modules/type-fest": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.13.1.tgz", + "integrity": "sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "license": "MIT", + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/typescript": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-7.0.2.tgz", + "integrity": "sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA==", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "bin": { + "tsc": "bin/tsc" + }, + "engines": { + "node": ">=16.20.0" + }, + "optionalDependencies": { + "@typescript/typescript-aix-ppc64": "7.0.2", + "@typescript/typescript-darwin-arm64": "7.0.2", + "@typescript/typescript-darwin-x64": "7.0.2", + "@typescript/typescript-freebsd-arm64": "7.0.2", + "@typescript/typescript-freebsd-x64": "7.0.2", + "@typescript/typescript-linux-arm": "7.0.2", + "@typescript/typescript-linux-arm64": "7.0.2", + "@typescript/typescript-linux-loong64": "7.0.2", + "@typescript/typescript-linux-mips64el": "7.0.2", + "@typescript/typescript-linux-ppc64": "7.0.2", + "@typescript/typescript-linux-riscv64": "7.0.2", + "@typescript/typescript-linux-s390x": "7.0.2", + "@typescript/typescript-linux-x64": "7.0.2", + "@typescript/typescript-netbsd-arm64": "7.0.2", + "@typescript/typescript-netbsd-x64": "7.0.2", + "@typescript/typescript-openbsd-arm64": "7.0.2", + "@typescript/typescript-openbsd-x64": "7.0.2", + "@typescript/typescript-sunos-x64": "7.0.2", + "@typescript/typescript-win32-arm64": "7.0.2", + "@typescript/typescript-win32-x64": "7.0.2" + } + }, + "node_modules/typical": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", + "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/uid-safe": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/uid-safe/-/uid-safe-2.1.5.tgz", + "integrity": "sha512-KPHm4VL5dDXKz01UuEd88Df+KzynaohSL9fBh096KWAxSKZQDI2uBrVqtvRM4rwrIrRRKsdLNML/lnaaVSRioA==", + "license": "MIT", + "dependencies": { + "random-bytes": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/undici": { + "version": "5.29.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.29.0.tgz", + "integrity": "sha512-raqeBD6NQK4SkWhQzeYKd1KmIG6dllBOTt55Rmkt4HtI9mwdWtJljnrXjAFUBLTSN67HWrOIZ3EPF4kjUw80Bg==", + "license": "MIT", + "dependencies": { + "@fastify/busboy": "^2.0.0" + }, + "engines": { + "node": ">=14.0" + } + }, + "node_modules/undici-types": { + "version": "8.9.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.9.0.tgz", + "integrity": "sha512-KTDyRTYX8sWmKXAikPHHSyc63CRPETMctyjKFupcC6OBLXT3xsN0e9aF7m+mIXutFWpUXuedtowG7iLOzp0kQg==", + "license": "MIT" + }, + "node_modules/unescape": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/unescape/-/unescape-1.0.1.tgz", + "integrity": "sha512-O0+af1Gs50lyH1nUu3ZyYS1cRh01Q/kUKatTOkSs7jukXE6/NebucDVxyiDsA9AQ4JC1V1jUH9EO8JX2nMDgGQ==", + "license": "MIT", + "dependencies": { + "extend-shallow": "^2.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/upper-case": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/upper-case/-/upper-case-2.0.2.tgz", + "integrity": "sha512-KgdgDGJt2TpuwBUIjgG6lzw2GWFRCW9Qkfkiv0DxqHHLYJHmtmdUIKcZd8rHgFSjopVTlw6ggzCm1b8MFQwikg==", + "license": "MIT", + "dependencies": { + "tslib": "^2.0.3" + } + }, + "node_modules/upper-case-first": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/upper-case-first/-/upper-case-first-2.0.2.tgz", + "integrity": "sha512-514ppYHBaKwfJRK/pNC6c/OxfGa0obSnAl106u97Ed0I625Nin96KAjttZF6ZL3e1XLtphxnqrOi9iWgm+u+bg==", + "license": "MIT", + "dependencies": { + "tslib": "^2.0.3" + } + }, + "node_modules/urijs": { + "version": "1.19.11", + "resolved": "https://registry.npmjs.org/urijs/-/urijs-1.19.11.tgz", + "integrity": "sha512-HXgFDgDommxn5/bIv0cnQZsPhHDA90NPHD6+c/v21U5+Sx5hoP8+dP9IZXBU1gIfvdRfhG8cel9QNPeionfcCQ==", + "license": "MIT" + }, + "node_modules/urllib": { + "version": "2.44.1", + "resolved": "https://registry.npmjs.org/urllib/-/urllib-2.44.1.tgz", + "integrity": "sha512-vreOVvFizoiIz5NK9IYMgUknkriHHBVccn2VFfJhgKz6O2qwm0SgjFk4OpXFRDXpdrTx8EzM1DB0/pejrqXwPA==", + "license": "MIT", + "dependencies": { + "any-promise": "^1.3.0", + "content-type": "^1.0.2", + "default-user-agent": "^1.0.0", + "digest-header": "^1.0.0", + "ee-first": "~1.1.1", + "formstream": "^1.1.0", + "humanize-ms": "^1.2.0", + "iconv-lite": "^0.6.3", + "pump": "^3.0.0", + "qs": "^6.4.0", + "statuses": "^1.3.1", + "utility": "^1.16.1" + }, + "engines": { + "node": ">= 0.10.0" + }, + "peerDependencies": { + "proxy-agent": "^5.0.0" + }, + "peerDependenciesMeta": { + "proxy-agent": { + "optional": true + } + } + }, + "node_modules/urllib-next": { + "name": "urllib", + "version": "3.27.3", + "resolved": "https://registry.npmjs.org/urllib/-/urllib-3.27.3.tgz", + "integrity": "sha512-24ht/hHAkhWXbqSCM499B8gFPXaf4aFQJNqJH5pMsvfyo+aM3zKuQ/uiZ/mdz41Nnw6ItuiqMVMK5VDAlAHLlw==", + "license": "MIT", + "dependencies": { + "default-user-agent": "^1.0.0", + "digest-header": "^1.0.0", + "form-data-encoder": "^1.7.2", + "formdata-node": "^4.3.3", + "formstream": "^1.1.1", + "mime-types": "^2.1.35", + "pump": "^3.0.0", + "qs": "^6.11.2", + "type-fest": "^4.3.1", + "undici": "^5.28.2", + "ylru": "^1.3.2" + }, + "engines": { + "node": ">= 14.19.3" + } + }, + "node_modules/urllib-next/node_modules/type-fest": { + "version": "4.41.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.41.0.tgz", + "integrity": "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==", + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/urllib/node_modules/statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/urllib/node_modules/utility": { + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/utility/-/utility-1.18.0.tgz", + "integrity": "sha512-PYxZDA+6QtvRvm//++aGdmKG/cI07jNwbROz0Ql+VzFV1+Z0Dy55NI4zZ7RHc9KKpBePNFwoErqIuqQv/cjiTA==", + "license": "MIT", + "dependencies": { + "copy-to": "^2.0.1", + "escape-html": "^1.0.3", + "mkdirp": "^0.5.1", + "mz": "^2.7.0", + "unescape": "^1.0.1" + }, + "engines": { + "node": ">= 0.12.0" + } + }, + "node_modules/urllib4": { + "name": "urllib", + "version": "4.9.0", + "resolved": "https://registry.npmjs.org/urllib/-/urllib-4.9.0.tgz", + "integrity": "sha512-Rp3DBvVqy9arSTMH6oN5N7OAN01U3dQ2xc19AadP86MzC4j67MDeqOup5shpWnjkDVGWfLfWPOd8CyqOtd6u3w==", + "license": "MIT", + "dependencies": { + "form-data": "^4.0.1", + "formstream": "^1.5.1", + "mime-types": "^2.1.35", + "qs": "^6.12.1", + "type-fest": "^4.20.1", + "undici": "^7.1.1", + "ylru": "^2.0.0" + }, + "engines": { + "node": ">= 18.19.0" + } + }, + "node_modules/urllib4/node_modules/type-fest": { + "version": "4.41.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.41.0.tgz", + "integrity": "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==", + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/urllib4/node_modules/undici": { + "version": "7.30.1", + "resolved": "https://registry.npmjs.org/undici/-/undici-7.30.1.tgz", + "integrity": "sha512-03KrMbjIFDWQR5RNPrSw3bd1r12JpyFQl9/yxjUbJtqkjmllqC5lFjZh6ujeuJCKr8EOQvRW872Oy/az+nLYxg==", + "license": "MIT", + "engines": { + "node": ">=20.18.1" + } + }, + "node_modules/urllib4/node_modules/ylru": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ylru/-/ylru-2.0.0.tgz", + "integrity": "sha512-T6hTrKcr9lKeUG0MQ/tO72D3UGptWVohgzpHG8ljU1jeBt2RCjcWxvsTPD8ZzUq1t1FvwROAw1kxg2euvg/THg==", + "license": "MIT", + "engines": { + "node": ">= 18.19.0" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "license": "MIT" + }, + "node_modules/utility": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/utility/-/utility-2.5.0.tgz", + "integrity": "sha512-lDbOVde5UAKgtxrSyZNhqrTA7f7anba6DTqbsDWgUFk6PZlmr7djqPYw0FnL5a6TbJvRt38VmYqt07zVLzXG2A==", + "license": "MIT", + "dependencies": { + "escape-html": "^1.0.3", + "unescape": "^1.0.1", + "ylru": "^2.0.0" + }, + "engines": { + "node": ">= 16.0.0" + } + }, + "node_modules/utility/node_modules/ylru": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ylru/-/ylru-2.0.0.tgz", + "integrity": "sha512-T6hTrKcr9lKeUG0MQ/tO72D3UGptWVohgzpHG8ljU1jeBt2RCjcWxvsTPD8ZzUq1t1FvwROAw1kxg2euvg/THg==", + "license": "MIT", + "engines": { + "node": ">= 18.19.0" + } + }, + "node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "deprecated": "uuid@10 and below is no longer supported. For ESM codebases, update to uuid@latest. For CommonJS codebases, use uuid@11 (but be aware this version will likely be deprecated in 2028).", + "license": "MIT", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/v8-compile-cache-lib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", + "dev": true, + "license": "MIT" + }, + "node_modules/v8-to-istanbul": { + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz", + "integrity": "sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA==", + "dev": true, + "license": "ISC", + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.12", + "@types/istanbul-lib-coverage": "^2.0.1", + "convert-source-map": "^2.0.0" + }, + "engines": { + "node": ">=10.12.0" + } + }, + "node_modules/v8-to-istanbul/node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@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/validator": { + "version": "13.15.35", + "resolved": "https://registry.npmjs.org/validator/-/validator-13.15.35.tgz", + "integrity": "sha512-TQ5pAGhd5whStmqWvYF4OjQROlmv9SMFVt37qoCBdqRffuuklWYQlCNnEs2ZaIBD1kZRNnikiZOS1eqgkar0iw==", + "license": "MIT", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/wcwidth": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", + "integrity": "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==", + "dev": true, + "license": "MIT", + "dependencies": { + "defaults": "^1.0.3" + } + }, + "node_modules/web-streams-polyfill": { + "version": "4.0.0-beta.3", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-4.0.0-beta.3.tgz", + "integrity": "sha512-QW95TCTaHmsYfHDybGMwO5IJIM93I/6vTRk+daHTWFPhwh+C8Cg7j7XyKrwrj8Ib6vYXe0ocYNrmzY4xAAN6ug==", + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, + "node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, + "node_modules/which-module": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz", + "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==", + "license": "ISC" + }, + "node_modules/win-release": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/win-release/-/win-release-1.1.1.tgz", + "integrity": "sha512-iCRnKVvGxOQdsKhcQId2PXV1vV3J/sDPXKA4Oe9+Eti2nb2ESEsYHRYls/UjoUW3bIc5ZDO8dTH50A/5iVN+bw==", + "license": "MIT", + "dependencies": { + "semver": "^5.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wkx": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/wkx/-/wkx-0.5.0.tgz", + "integrity": "sha512-Xng/d4Ichh8uN4l0FToV/258EjMGU9MGcA0HV2d9B/ZpZB3lqQm7nkOdZdm5GhKtLLhAE7PiVQwN4eN+2YJJUg==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/wordwrapjs": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/wordwrapjs/-/wordwrapjs-4.0.1.tgz", + "integrity": "sha512-kKlNACbvHrkpIw6oPeYDSmdCTu2hdMHoyXLTcUKala++lx5Y+wjJ/e474Jqv5abnVmwxw08DiTuHmw69lJGksA==", + "dev": true, + "license": "MIT", + "dependencies": { + "reduce-flatten": "^2.0.0", + "typical": "^5.2.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/workerpool": { + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.5.1.tgz", + "integrity": "sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/wrap-ansi/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "license": "ISC" + }, + "node_modules/wt": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/wt/-/wt-1.2.0.tgz", + "integrity": "sha512-nJttxFyxnIvWBWYcy7Px4XkXbRoEe77by66d0FDof266Mv00vVBNcUGa00rL1+0DdsXG75LG1rwBnBfUa2bNLA==", + "license": "MIT", + "dependencies": { + "debug": "^2.2.0", + "ndir": "^0.1.5", + "sdk-base": "^2.0.1" + }, + "engines": { + "node": ">= 0.12.9" + } + }, + "node_modules/wt/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/wt/node_modules/get-ready": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/get-ready/-/get-ready-1.0.0.tgz", + "integrity": "sha512-mFXCZPJIlcYcth+N8267+mghfYN9h3EhsDa6JSnbA3Wrhh/XFpuowviFcsDeYZtKspQyWyJqfs4O6P8CHeTwzw==", + "license": "MIT" + }, + "node_modules/wt/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/wt/node_modules/sdk-base": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/sdk-base/-/sdk-base-2.0.1.tgz", + "integrity": "sha512-eeG26wRwhtwYuKGCDM3LixCaxY27Pa/5lK4rLKhQa7HBjJ3U3Y+f81MMZQRsDw/8SC2Dao/83yJTXJ8aULuN8Q==", + "license": "MIT", + "dependencies": { + "get-ready": "~1.0.0" + } + }, + "node_modules/xss": { + "version": "1.0.15", + "resolved": "https://registry.npmjs.org/xss/-/xss-1.0.15.tgz", + "integrity": "sha512-FVdlVVC67WOIPvfOwhoMETV72f6GbW7aOabBC3WxN/oUdoEMDyLz4OgRv5/gck2ZeNqEQu+Tb0kloovXOfpYVg==", + "license": "MIT", + "dependencies": { + "commander": "^2.20.3", + "cssfilter": "0.0.10" + }, + "bin": { + "xss": "bin/xss" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "license": "MIT", + "engines": { + "node": ">=0.4" + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs": { + "version": "17.7.3", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.3.tgz", + "integrity": "sha512-GZtjxm/J/4TSxuL3FNYjCmLktBTnIw/rVmKSIyKeYAZpmJB2ig9VauCC5xsa82GNKVKDAqpOn3KVzNt0zmrU0g==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-unparser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", + "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", + "dev": true, + "license": "MIT", + "dependencies": { + "camelcase": "^6.0.0", + "decamelize": "^4.0.0", + "flat": "^5.0.2", + "is-plain-obj": "^2.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs-unparser/node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ylru": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/ylru/-/ylru-1.4.0.tgz", + "integrity": "sha512-2OQsPNEmBCvXuFlIni/a+Rn+R2pHW9INm0BxXJ4hVDA8TirqMj+J/Rp9ItLatT/5pZqWwefVrTQcHpixsxnVlA==", + "license": "MIT", + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/zlogger": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/zlogger/-/zlogger-1.1.0.tgz", + "integrity": "sha512-WjRPkjHe4rajXun45zZRAnViTSLkIr2PEFI303u+3NYIkhWqxhpTr0j67XPzhTJMmDH27pGoTSxGg/qP8FiaJA==", + "license": "MIT", + "dependencies": { + "pumpify": "^1.3.5", + "split2": "^2.1.0", + "through2": "^2.0.1" + }, + "engines": { + "node": ">=4.3.1" + } + } + } +} diff --git a/backend/package.json b/backend/package.json new file mode 100644 index 0000000..0f58388 --- /dev/null +++ b/backend/package.json @@ -0,0 +1,41 @@ +{ + "name": "pack-service", + "version": "1.0.0", + "description": "Egg.js 接口服务(MySQL + Redis)", + "private": true, + "egg": { + "declarations": true + }, + "dependencies": { + "bcryptjs": "^3.0.3", + "egg": "^3.34.0", + "egg-redis": "^2.6.1", + "egg-scripts": "^3.1.0", + "egg-sequelize": "^6.0.0", + "http-proxy": "^1.18.1", + "jsonwebtoken": "^9.0.3", + "koa-static": "^5.0.0", + "mysql2": "^3.24.6", + "nodemailer": "^10.1.2", + "qrcode-generator": "^2.0.4", + "sequelize": "^6.37.8" + }, + "devDependencies": { + "egg-bin": "^6.13.0", + "egg-mock": "^5.15.2" + }, + "engines": { + "node": ">=18.0.0" + }, + "scripts": { + "start": "egg-scripts start --daemon --title=egg-server-pack-service", + "stop": "egg-scripts stop --title=egg-server-pack-service", + "dev": "egg-bin dev", + "dev:test": "egg-bin dev --port 7300", + "debug": "egg-bin debug", + "test": "egg-bin test", + "cov": "egg-bin cov", + "db:init": "node scripts/init-db.js", + "user:pass": "node scripts/set-password.js" + } +} diff --git a/backend/scripts/db-config.js b/backend/scripts/db-config.js new file mode 100644 index 0000000..0cde474 --- /dev/null +++ b/backend/scripts/db-config.js @@ -0,0 +1,33 @@ +'use strict'; + +/** + * 脚本共用的数据库连接信息解析: + * 环境变量 > config/config.local.js(已 gitignore)> 内置默认值 + */ + +const fs = require('fs'); +const path = require('path'); + +const { env } = process; + +module.exports = function resolveDbConfig() { + const config = { + host: env.MYSQL_HOST || '127.0.0.1', + port: Number(env.MYSQL_PORT || 3307), + user: env.MYSQL_USER || 'packservice', + password: env.MYSQL_PASSWORD || '', + database: env.MYSQL_DATABASE || 'packservice', + multipleStatements: true, + }; + + const localPath = path.join(__dirname, '..', 'config', 'config.local.js'); + if (fs.existsSync(localPath)) { + const { sequelize = {} } = require(localPath); + if (sequelize.host) config.host = sequelize.host; + if (sequelize.port) config.port = sequelize.port; + if (sequelize.username) config.user = sequelize.username; + if (sequelize.password !== undefined) config.password = sequelize.password; + if (sequelize.database) config.database = sequelize.database; + } + return config; +}; diff --git a/backend/scripts/init-db.js b/backend/scripts/init-db.js new file mode 100644 index 0000000..a27e6f3 --- /dev/null +++ b/backend/scripts/init-db.js @@ -0,0 +1,54 @@ +'use strict'; + +/** + * 执行 sql/schema.sql 建表(本机没装 mysql 客户端时用它) + * + * 用法: + * npm run db:init # 执行 sql/schema.sql + * node scripts/init-db.js sql/xxx.sql # 执行指定 SQL 文件 + * + * 连接信息来源:环境变量 > config/config.local.js > 内置默认值 + */ + +const fs = require('fs'); +const path = require('path'); +const mysql = require('mysql2/promise'); + +// 数据库连接信息统一在 scripts/db-config.js 里解析 +// (环境变量 > config/config.local.js > 默认值) +const resolveDbConfig = require('./db-config'); + +/** 去掉 -- 行注释,再按分号切分成可逐条执行的语句 */ +function splitStatements(sql) { + return sql + .split(/\r?\n/) + .filter((line) => !line.trim().startsWith('--')) + .join('\n') + .split(';') + .map((stmt) => stmt.trim()) + .filter(Boolean); +} + +async function main() { + const file = process.argv[2] || path.join(__dirname, '..', 'sql', 'schema.sql'); + const config = resolveDbConfig(); + const statements = splitStatements(fs.readFileSync(file, 'utf8')); + + console.log(`[db:init] 连接 ${config.host}:${config.port}/${config.database} as ${config.user}`); + const conn = await mysql.createConnection(config); + try { + for (const stmt of statements) { + console.log(`[db:init] 执行: ${stmt.split('\n')[0].slice(0, 70)} ...`); + await conn.query(stmt); + } + const [tables] = await conn.query('SHOW TABLES'); + console.log('[db:init] 完成,当前表: %s', tables.map((t) => Object.values(t)[0]).join(', ') || '(空)'); + } finally { + await conn.end(); + } +} + +main().catch((err) => { + console.error(`[db:init] 失败: ${err.code || ''} ${err.message}`); + process.exit(1); +}); diff --git a/backend/scripts/set-password.js b/backend/scripts/set-password.js new file mode 100644 index 0000000..808666d --- /dev/null +++ b/backend/scripts/set-password.js @@ -0,0 +1,64 @@ +'use strict'; + +/** + * 创建用户 / 重置登录密码(本机没装 mysql 客户端也能用) + * + * 用法: + * npm run user:pass -- <账号> <密码> [昵称] + * node scripts/set-password.js admin 123456 管理员 + * + * 账号不存在时自动创建(username = 账号,status = 1); + * 账号存在时只重置密码。密码经 bcrypt 哈希后写入 users.password_hash。 + */ + +const mysql = require('mysql2/promise'); +const bcrypt = require('bcryptjs'); +const resolveDbConfig = require('./db-config'); + +/** 与 app/service/auth.js 的 BCRYPT_ROUNDS 保持一致 */ +const BCRYPT_ROUNDS = 10; + +function usage() { + console.log('用法: npm run user:pass -- <账号> <密码> [昵称]'); + console.log('示例: npm run user:pass -- admin 123456 管理员'); +} + +async function main() { + const [ account, password, nickname ] = process.argv.slice(2); + if (!account || !password) { + usage(); + process.exit(1); + } + + const hash = await bcrypt.hash(String(password), BCRYPT_ROUNDS); + const config = resolveDbConfig(); + const conn = await mysql.createConnection(config); + + try { + const [rows] = await conn.query( + 'select id, username, phone, email from users where (username = ? or phone = ? or email = ?) and deleted_at is null limit 1', + [ account, account, account ], + ); + + if (rows.length) { + const user = rows[0]; + await conn.query('update users set password_hash = ?, updated_at = now() where id = ?', [ hash, user.id ]); + console.log(`[user:pass] 已重置密码: ${user.username || user.phone || user.email} (id=${user.id})`); + } else { + const [result] = await conn.query( + 'insert into users (username, nickname, password_hash, status) values (?, ?, ?, 1)', + [ account, nickname || account, hash ], + ); + console.log(`[user:pass] 已创建用户: ${account} (id=${result.insertId}),昵称: ${nickname || account}`); + } + + console.log(`[user:pass] 连接: ${config.host}:${config.port}/${config.database} as ${config.user}`); + } finally { + await conn.end(); + } +} + +main().catch((err) => { + console.error(`[user:pass] 失败: ${err.code || ''} ${err.message}`); + process.exit(1); +}); diff --git a/backend/sql/migrations/20261016_add_user_email.sql b/backend/sql/migrations/20261016_add_user_email.sql new file mode 100644 index 0000000..74c8ed3 --- /dev/null +++ b/backend/sql/migrations/20261016_add_user_email.sql @@ -0,0 +1,10 @@ +-- users 表增加邮箱字段(可选,唯一;登录时邮箱可作为账号,注册时可选填) +-- +-- ⚠️ 只需执行一次:MySQL 8 不支持 ADD COLUMN IF NOT EXISTS,重复执行会报 Duplicate column name。 +-- 执行:npm run db:init sql/migrations/20261016_add_user_email.sql + +ALTER TABLE `users` + ADD COLUMN `email` VARCHAR(128) DEFAULT NULL COMMENT '邮箱(可选,可作登录账号)' AFTER `nickname`; + +ALTER TABLE `users` + ADD UNIQUE KEY `uk_email` (`email`); diff --git a/backend/sql/migrations/20261016_add_user_password.sql b/backend/sql/migrations/20261016_add_user_password.sql new file mode 100644 index 0000000..dcacbcc --- /dev/null +++ b/backend/sql/migrations/20261016_add_user_password.sql @@ -0,0 +1,7 @@ +-- users 表增加登录密码字段(bcrypt 哈希) +-- +-- ⚠️ 只需执行一次:MySQL 8 不支持 ADD COLUMN IF NOT EXISTS,重复执行会报 Duplicate column name。 +-- 执行:npm run db:init sql/migrations/20261016_add_user_password.sql + +ALTER TABLE `users` + ADD COLUMN `password_hash` VARCHAR(100) DEFAULT NULL COMMENT '密码哈希(bcrypt),登录用' AFTER `phone`; diff --git a/backend/sql/migrations/20261016_devices_to_scanners.sql b/backend/sql/migrations/20261016_devices_to_scanners.sql new file mode 100644 index 0000000..16029f0 --- /dev/null +++ b/backend/sql/migrations/20261016_devices_to_scanners.sql @@ -0,0 +1,8 @@ +-- 从「设备(devices)」重命名为「扫描器(scanners)」, +-- 并把扫描器令牌改为长期 JWT(库里只存 jti,不存令牌本体)。 +-- +-- ⚠️ 只需执行一次:直接删掉上一版的 devices 表(当时只有演示数据)。 +-- 新表由 sql/schema.sql 的 CREATE TABLE `scanners` 建立(含 token_jti / last_seen_at)。 +-- 执行:npm run db:init sql/migrations/20261016_devices_to_scanners.sql + +DROP TABLE IF EXISTS `devices`; diff --git a/backend/sql/migrations/20261016_rebuild_users.sql b/backend/sql/migrations/20261016_rebuild_users.sql new file mode 100644 index 0000000..1ecddb8 --- /dev/null +++ b/backend/sql/migrations/20261016_rebuild_users.sql @@ -0,0 +1,7 @@ +-- 重建 users 表:旧的 demo 表(id/name/email/age)已废弃, +-- 新结构见 sql/schema.sql(BIGINT 主键 + 软删除 + 状态)。 +-- +-- ⚠️ 会删除 users 表及其数据,只执行一次(当前表内只有示例数据)。 +-- 执行:npm run db:init sql/migrations/20261016_rebuild_users.sql + +DROP TABLE IF EXISTS `users`; diff --git a/backend/sql/schema.sql b/backend/sql/schema.sql new file mode 100644 index 0000000..0e358f5 --- /dev/null +++ b/backend/sql/schema.sql @@ -0,0 +1,191 @@ +-- packservice 库初始化脚本(幂等,可重复执行) +-- +-- 前提:数据库 `packservice` 已存在(账号 packservice 只有该库的权限,无法建库)。 +-- 若需新建库,请用有权限的账号执行: +-- CREATE DATABASE IF NOT EXISTS `packservice` +-- DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; +-- +-- 执行方式: +-- npm run db:init +-- mysql -h127.0.0.1 -P3307 -upackservice -p packservice < sql/schema.sql +-- +-- ⚠️ 历史变更(旧库需要按顺序补跑一次迁移): +-- 1. users 表结构重建(旧的 demo 表只有 id/name/email/age) +-- npm run db:init sql/migrations/20261016_rebuild_users.sql +-- 2. users 表增加登录密码字段 +-- npm run db:init sql/migrations/20261016_add_user_password.sql +-- +-- 通用约定:BIGINT UNSIGNED 自增主键 + created_at/updated_at + deleted_at(软删除) + status + +USE `packservice`; + +-- --------------------------------------------------------------- +-- 用户表 +-- --------------------------------------------------------------- +CREATE TABLE IF NOT EXISTS `users` ( + `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键', + `username` VARCHAR(64) DEFAULT NULL COMMENT '登录名(可空,纯微信登录用户可不设)', + `nickname` VARCHAR(64) NOT NULL DEFAULT '' COMMENT '昵称', + `email` VARCHAR(128) DEFAULT NULL COMMENT '邮箱(可选,可作登录账号)', + `avatar` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '头像地址', + `phone` VARCHAR(20) DEFAULT NULL COMMENT '手机号', + `password_hash` VARCHAR(100) DEFAULT NULL COMMENT '密码哈希(bcrypt),登录用', + `gender` TINYINT UNSIGNED NOT NULL DEFAULT 0 COMMENT '性别:0未知 1男 2女', + `status` TINYINT UNSIGNED NOT NULL DEFAULT 1 COMMENT '状态:1正常 0禁用', + `remark` VARCHAR(255) DEFAULT NULL COMMENT '备注', + `last_login_at` DATETIME DEFAULT NULL COMMENT '最近登录时间', + `created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `updated_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', + `deleted_at` DATETIME DEFAULT NULL COMMENT '软删除时间', + PRIMARY KEY (`id`), + UNIQUE KEY `uk_username` (`username`), + UNIQUE KEY `uk_phone` (`phone`), + UNIQUE KEY `uk_email` (`email`), + KEY `idx_status` (`status`), + KEY `idx_created_at` (`created_at`) +) ENGINE = InnoDB + DEFAULT CHARSET = utf8mb4 + COMMENT = '用户表'; + +-- --------------------------------------------------------------- +-- 微信授权表:一条记录 = 某用户在某 appid 下的一次授权 +-- 一个用户可绑定多个微信(公众号 / 小程序 / 开放平台) +-- --------------------------------------------------------------- +CREATE TABLE IF NOT EXISTS `wechat_oauth` ( + `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键', + `user_id` BIGINT UNSIGNED NOT NULL COMMENT '关联 users.id', + `appid` VARCHAR(64) NOT NULL COMMENT '微信 appid', + `openid` VARCHAR(64) NOT NULL COMMENT '用户在该 appid 下的 openid', + `unionid` VARCHAR(64) DEFAULT NULL COMMENT '开放平台 unionid', + `nickname` VARCHAR(64) NOT NULL DEFAULT '' COMMENT '授权时微信昵称', + `avatar` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '授权时微信头像', + `session_key` VARCHAR(128) DEFAULT NULL COMMENT '小程序 session_key', + `access_token` VARCHAR(512) DEFAULT NULL COMMENT '网页授权 access_token', + `refresh_token` VARCHAR(512) DEFAULT NULL COMMENT '刷新令牌', + `scope` VARCHAR(64) DEFAULT NULL COMMENT '授权 scope', + `token_expires_at` DATETIME DEFAULT NULL COMMENT 'access_token 过期时间', + `last_auth_at` DATETIME DEFAULT NULL COMMENT '最近授权时间', + `created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `updated_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', + `deleted_at` DATETIME DEFAULT NULL COMMENT '软删除时间', + PRIMARY KEY (`id`), + UNIQUE KEY `uk_appid_openid` (`appid`, `openid`), + KEY `idx_user_id` (`user_id`), + KEY `idx_unionid` (`unionid`) +) ENGINE = InnoDB + DEFAULT CHARSET = utf8mb4 + COMMENT = '微信授权表'; + +-- --------------------------------------------------------------- +-- 系统配置表:group_name + config_key 唯一定位一条配置 +-- 注意:唯一性由 service 层保证(先查后写),这里只建普通索引 —— +-- 本表用 deleted_at 软删除,唯一索引会被已删除的记录占用,导致同 key 无法重建。 +-- --------------------------------------------------------------- +CREATE TABLE IF NOT EXISTS `sys_config` ( + `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键', + `group_name` VARCHAR(64) NOT NULL DEFAULT 'default' COMMENT '分组', + `config_key` VARCHAR(128) NOT NULL COMMENT '配置键', + `config_value` TEXT COMMENT '配置值', + `value_type` VARCHAR(16) NOT NULL DEFAULT 'string' COMMENT 'string/number/boolean/json', + `remark` VARCHAR(255) DEFAULT NULL COMMENT '备注', + `status` TINYINT UNSIGNED NOT NULL DEFAULT 1 COMMENT '状态:1启用 0禁用', + `created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `updated_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', + `deleted_at` DATETIME DEFAULT NULL COMMENT '软删除时间', + PRIMARY KEY (`id`), + KEY `idx_group_key` (`group_name`, `config_key`), + KEY `idx_group` (`group_name`) +) ENGINE = InnoDB + DEFAULT CHARSET = utf8mb4 + COMMENT = '系统配置表'; + +-- --------------------------------------------------------------- +-- 扫描器表:扫描器(条码/二维码)端登录后注册到服务,并与账号绑定(user_id 为空 = 未绑定) +-- --------------------------------------------------------------- +CREATE TABLE IF NOT EXISTS `scanners` ( + `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键', + `user_id` BIGINT UNSIGNED DEFAULT NULL COMMENT '绑定的用户 id,未绑定为 NULL', + `sn` VARCHAR(64) NOT NULL COMMENT '扫描器 SN(唯一标识)', + `name` VARCHAR(64) NOT NULL DEFAULT '' COMMENT '名称 / 别名', + `vendor` VARCHAR(64) DEFAULT NULL COMMENT '厂商', + `model` VARCHAR(64) DEFAULT NULL COMMENT '型号', + `firmware` VARCHAR(32) DEFAULT NULL COMMENT '固件 / 客户端版本', + `ip` VARCHAR(45) DEFAULT NULL COMMENT '最近登录 IP', + `secret_hash` VARCHAR(100) DEFAULT NULL COMMENT '扫描器密钥哈希(bcrypt),扫描器端登录用', + `token_jti` VARCHAR(64) DEFAULT NULL COMMENT '当前 JWT 的 jti(重签即失效旧令牌)', + `token_expires_at` DATETIME DEFAULT NULL COMMENT '令牌过期时间', + `status` TINYINT UNSIGNED NOT NULL DEFAULT 1 COMMENT '状态:1正常 0禁用', + `last_register_at` DATETIME DEFAULT NULL COMMENT '最近注册时间', + `last_login_at` DATETIME DEFAULT NULL COMMENT '最近登录时间', + `last_seen_at` DATETIME DEFAULT NULL COMMENT '最近心跳时间', + `created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `updated_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', + `deleted_at` DATETIME DEFAULT NULL COMMENT '软删除时间', + PRIMARY KEY (`id`), + UNIQUE KEY `uk_sn` (`sn`), + UNIQUE KEY `uk_token_jti` (`token_jti`), + KEY `idx_user_id` (`user_id`), + KEY `idx_status` (`status`) +) ENGINE = InnoDB + DEFAULT CHARSET = utf8mb4 + COMMENT = '扫描器表'; + +-- --------------------------------------------------------------- +-- 扫描中控通道表:中控(绑定端)上报的通道,一个通道一行 +-- 一台中控可接多个扫码设备,每个扫码设备对应一个通道(channel_id + channel_name) +-- channel_id 只在同一中控内唯一,所以唯一键是 (scanner_id, channel_id) +-- --------------------------------------------------------------- +CREATE TABLE IF NOT EXISTS `scan_channels` ( + `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键', + `scanner_id` BIGINT UNSIGNED NOT NULL COMMENT '上报的中控(= scanners.id)', + `channel_id` VARCHAR(64) NOT NULL COMMENT '通道 id(中控上报,同一中控内唯一)', + `channel_name` VARCHAR(128) NOT NULL DEFAULT '' COMMENT '通道名(中控上报)', + `last_report_at` DATETIME DEFAULT NULL COMMENT '最近一次上报时间', + `status` TINYINT UNSIGNED NOT NULL DEFAULT 1 COMMENT '状态:1正常 0停用', + `remark` VARCHAR(255) DEFAULT NULL COMMENT '备注', + `created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `updated_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', + `deleted_at` DATETIME DEFAULT NULL COMMENT '软删除时间', + PRIMARY KEY (`id`), + UNIQUE KEY `uk_scanner_channel` (`scanner_id`, `channel_id`), + KEY `idx_channel_id` (`channel_id`), + KEY `idx_status` (`status`) +) ENGINE = InnoDB + DEFAULT CHARSET = utf8mb4 + COMMENT = '扫描中控通道表'; + +-- --------------------------------------------------------------- +-- 扫码记录表:中控上报的扫码流水(条码 + 扫描时间 + 通道) +-- 去重:唯一键 (scanner_id, channel_id, barcode, scan_time) —— +-- 同一中控 + 同一通道 + 同一时间 + 同一条码 的重复上报只入库一次(幂等重试安全)。 +-- 时间精确到秒;重复上报不会报错,接口返回 duplicated 计数。 +-- 说明:本表是流水表,不用软删除(软删除会占用唯一键,导致同一条记录无法再入库); +-- 需要清理请按时间物理删除(DELETE ... WHERE scan_time < ?)。 +-- --------------------------------------------------------------- +CREATE TABLE IF NOT EXISTS `scan_records` ( + `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键', + `scanner_id` BIGINT UNSIGNED NOT NULL COMMENT '上报的中控(= scanners.id)', + `channel_id` VARCHAR(64) NOT NULL COMMENT '通道 id', + `barcode` VARCHAR(255) NOT NULL COMMENT '条码内容', + `scan_time` DATETIME NOT NULL COMMENT '扫描时间(中控上报,秒级)', + `reported_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '服务端接收时间', + `created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `updated_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', + PRIMARY KEY (`id`), + UNIQUE KEY `uk_scan_dedup` (`scanner_id`, `channel_id`, `barcode`, `scan_time`), + KEY `idx_scan_time` (`scan_time`), + KEY `idx_barcode` (`barcode`), + KEY `idx_channel_scan_time` (`channel_id`, `scan_time`) +) ENGINE = InnoDB + DEFAULT CHARSET = utf8mb4 + COMMENT = '扫码记录表(同 中控+通道+条码+扫描时间 去重)'; + +-- --------------------------------------------------------------- +-- 初始化配置(可选) +-- --------------------------------------------------------------- +INSERT INTO `sys_config` (`group_name`, `config_key`, `config_value`, `value_type`, `remark`) +SELECT 'wechat', 'default_appid', '', 'string', '默认微信 appid' +FROM DUAL +WHERE NOT EXISTS ( + SELECT 1 FROM `sys_config` WHERE `group_name` = 'wechat' AND `config_key` = 'default_appid' AND `deleted_at` IS NULL +); diff --git a/backend/test/app/controller/config.test.js b/backend/test/app/controller/config.test.js new file mode 100644 index 0000000..99711c4 --- /dev/null +++ b/backend/test/app/controller/config.test.js @@ -0,0 +1,206 @@ +'use strict'; + +const { app, mock, assert } = require('egg-mock/bootstrap'); +const createFakeRedis = require('../../utils/fake-redis'); +const { HEADER: INTERNAL } = require('../../utils/internal'); + +/** 系统配置属「内部接口」:请求都带上运维令牌 */ +const http = { + get: url => app.httpRequest().get(url).set(INTERNAL), + post: url => app.httpRequest().post(url).set(INTERNAL), + put: url => app.httpRequest().put(url).set(INTERNAL), + delete: url => app.httpRequest().delete(url).set(INTERNAL), +}; + +const instance = (data) => Object.assign({}, data, { + toJSON: () => data, + update: async (fields) => Object.assign(data, fields), +}); + +describe('test/app/controller/config.test.js', () => { + let fakeRedis; + + beforeEach(() => { + fakeRedis = createFakeRedis(); + mock(app, 'redis', fakeRedis.client); + }); + + it('GET /api/configs/:group/:key 读配置并写缓存', async () => { + let queries = 0; + mock(app, 'model', { + SysConfig: { + async findOne() { + queries++; + return instance({ groupName: 'wechat', configKey: 'appid', configValue: 'wx123', valueType: 'string' }); + }, + }, + }); + + const res = await http.get('/api/configs/wechat/appid').expect(200); + assert(res.body.data.value === 'wx123'); + assert(queries === 1); + assert(fakeRedis.store.get('packs:config:wechat:appid'), '应写入缓存'); + + // 第二次读命中缓存 + await http.get('/api/configs/wechat/appid').expect(200); + assert(queries === 1); + }); + + it('value_type 为 json / number / boolean 时自动转换类型', async () => { + const rows = { + json: { configValue: '{"a":1}', valueType: 'json' }, + number: { configValue: '42', valueType: 'number' }, + boolean: { configValue: 'true', valueType: 'boolean' }, + }; + mock(app, 'model', { + SysConfig: { + async findOne(options) { + const key = options.where.configKey; + return instance(Object.assign({ groupName: 'g', configKey: key }, rows[key])); + }, + }, + }); + + const json = await http.get('/api/configs/g/json').expect(200); + assert.deepStrictEqual(json.body.data.value, { a: 1 }); + + const number = await http.get('/api/configs/g/number').expect(200); + assert.strictEqual(number.body.data.value, 42); + + const boolean = await http.get('/api/configs/g/boolean').expect(200); + assert.strictEqual(boolean.body.data.value, true); + }); + + it('GET /api/configs/:group/:key 不存在(或已禁用)返回 404', async () => { + mock(app, 'model', { + SysConfig: { + async findOne() { + return null; + }, + }, + }); + + await http.get('/api/configs/wechat/none').expect(404); + }); + + it('GET /api/configs/:group 返回分组内启用的配置', async () => { + mock(app, 'model', { + SysConfig: { + async findAll() { + return [ + instance({ configKey: 'appid', configValue: 'wx123', valueType: 'string' }), + instance({ configKey: 'secret', configValue: 's1', valueType: 'string' }), + ]; + }, + }, + }); + + const res = await http.get('/api/configs/wechat').expect(200); + assert.deepStrictEqual(res.body.data, { appid: 'wx123', secret: 's1' }); + }); + + it('PUT /api/configs 新建配置', async () => { + mock(app, 'model', { + SysConfig: { + async findOne() { + return null; + }, + async create(data) { + assert(data.groupName === 'wechat'); + assert(data.configKey === 'secret'); + assert(data.configValue === 's1'); + return instance(Object.assign({ id: 3 }, data)); + }, + }, + }); + + const res = await http + .put('/api/configs') + .send({ groupName: 'wechat', configKey: 'secret', configValue: 's1' }) + .expect(200); + + assert(res.body.data.id === 3); + }); + + it('PUT /api/configs 更新已有配置并清掉缓存', async () => { + // 先读一次建立缓存 + mock(app, 'model', { + SysConfig: { + async findOne() { + return instance({ id: 3, groupName: 'wechat', configKey: 'appid', configValue: 'old', valueType: 'string' }); + }, + }, + }); + await http.get('/api/configs/wechat/appid').expect(200); + assert(fakeRedis.store.has('packs:config:wechat:appid')); + + // 再更新 + mock(app, 'model', { + SysConfig: { + async findOne() { + return instance({ + id: 3, + groupName: 'wechat', + configKey: 'appid', + configValue: 'old', + valueType: 'string', + }); + }, + }, + }); + + const res = await http + .put('/api/configs') + .send({ groupName: 'wechat', configKey: 'appid', configValue: 'new' }) + .expect(200); + + assert(res.body.data.configValue === 'new'); + assert(!fakeRedis.store.has('packs:config:wechat:appid'), '写入后应清除缓存'); + }); + + it('PUT /api/configs 缺少 configKey 返回 422', async () => { + await http.put('/api/configs').send({ groupName: 'wechat' }).expect(422); + }); + + it('GET /api/configs 列表(管理用)', async () => { + mock(app, 'model', { + SysConfig: { + async findAll(options) { + assert(options.where.groupName === 'wechat'); + return [ instance({ groupName: 'wechat', configKey: 'appid', configValue: 'wx123' }) ]; + }, + }, + }); + + const res = await http.get('/api/configs?group=wechat').expect(200); + assert(res.body.data.total === 1); + }); + + it('DELETE /api/configs/:group/:key 软删除并清缓存', async () => { + fakeRedis.store.set('packs:config:wechat:appid', '{}'); + + mock(app, 'model', { + SysConfig: { + async destroy(options) { + assert.deepStrictEqual(options.where, { groupName: 'wechat', configKey: 'appid' }); + return 1; + }, + }, + }); + + await http.delete('/api/configs/wechat/appid').expect(200); + assert(!fakeRedis.store.has('packs:config:wechat:appid')); + }); + + it('DELETE /api/configs/:group/:key 配置不存在返回 404', async () => { + mock(app, 'model', { + SysConfig: { + async destroy() { + return 0; + }, + }, + }); + + await http.delete('/api/configs/wechat/none').expect(404); + }); +}); diff --git a/backend/test/app/controller/device.test.js b/backend/test/app/controller/device.test.js new file mode 100644 index 0000000..bc7fb95 --- /dev/null +++ b/backend/test/app/controller/device.test.js @@ -0,0 +1,389 @@ +'use strict'; + +const { app, mock, assert } = require('egg-mock/bootstrap'); +const http = require('http'); +const createFakeRedis = require('../../utils/fake-redis'); + +/** 等一会儿(用来模拟「挂上长轮询之后,手机才确认」) */ +const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms)); + +/** Sequelize 实例的最小替身:update 的字段收集到 updates 里,同时并进 data(toJSON 会看到新值) */ +const instance = (data, updates) => Object.assign( + { + toJSON: () => data, + update: async (fields) => { + if (updates) updates.push(fields); + Object.assign(data, fields); + }, + }, + data, +); + +describe('test/app/controller/device.test.js', () => { + const userRow = { id: 7, username: 'admin', nickname: '管理员', email: 'admin@example.com', phone: null, status: 1 }; + + /** 用户模型固定桩 + 用例自己的扫描器模型 */ + function mockModels(scannerModel) { + mock(app, 'model', { + User: { + async findByPk(id) { + return instance(Object.assign({}, userRow, { id })); + }, + }, + Scanner: scannerModel, + }); + } + + /** 已登录用户的 JWT(手机端 /api/wechat/confirm 就是用它) */ + const userJwt = () => app.createAnonymousContext().service.jwt.signUser(userRow); + + /** 发码 → 挂长轮询 → 手机确认 → 等设备拿到结果 */ + async function scanFlow({ sn = null, wait = 10, expectPoll = 200 } = {}) { + const query = sn ? `?sn=${encodeURIComponent(sn)}` : ''; + const issued = await app.httpRequest().get(`/api/device/login${query}`).expect(200); + const code = issued.body.data.code; + + // 长轮询先挂着,150ms 后手机确认(走真实的 POST /api/wechat/confirm) + const polled = app.httpRequest() + .get(`/api/device/login${sn ? `?sn=${encodeURIComponent(sn)}&` : '?'}code=${code}&wait=${wait}`) + .expect(expectPoll); + await sleep(150); + + const confirmed = await app.httpRequest() + .post('/api/wechat/confirm') + .set('Authorization', `Bearer ${userJwt()}`) + .send({ code }) + .expect(200); + assert(confirmed.body.data.status === 'confirmed', JSON.stringify(confirmed.body)); + + return { code, res: await polled, issued: issued.body.data }; + } + + it('GET /api/device/login 发码:不需要任何凭据、也不建任何记录', async () => { + const fake = createFakeRedis(); + mock(app, 'redis', fake.client); + // 扫描器模型一个方法都不给:这一步要是碰了库,用例直接报错 + mockModels({}); + + let res = await app.httpRequest().get('/api/device/login').expect(200); + let d = res.body.data; + assert(d.status === 'pending', JSON.stringify(d)); + assert(/^[0-9A-Z]{6}$/.test(d.code), `应是 6 位数字+字母:${d.code}`); + assert(d.spm === `1.0.${d.code}.1`, d.spm); + assert(d.device.sn === null && d.device.name === null, `没报就是 null:${JSON.stringify(d.device)}`); + assert(d.expiresIn === app.config.wechat.stateTtl, '应返回登录码有效期'); + assert(await fake.client.get(`packs:wechat:state:${d.code}`) === 'pending', '登录码应登记为 pending'); + + // 设备不知道域名也能画二维码:接口把**完整网址**算好给它 + assert(/^https?:\/\/[^/]+$/.test(d.origin), `origin 应是「协议 + 主机」:${d.origin}`); + assert(d.qrContent === `${d.origin}/wechat?spm=1.0.${d.code}.1`, d.qrContent); + assert(d.qrImageUrl === `${d.origin}/api/wechat/qrcode.svg?code=${d.code}`, d.qrImageUrl); + assert(d.qrUrl === `/api/wechat/qrcode.svg?code=${d.code}`, d.qrUrl); + + // 带上设备自报信息:原样回显(此时同样不建记录) + // ⚠️ URL 里的中文必须 encodeURIComponent(supertest 会报 ERR_UNESCAPED_CHARACTERS) + res = await app.httpRequest() + .get(`/api/device/login?sn=SN-SCAN-01&name=${encodeURIComponent('门口扫码枪')}&vendor=acme`) + .expect(200); + d = res.body.data; + assert(d.device.sn === 'SN-SCAN-01' && d.device.name === '门口扫码枪', JSON.stringify(d.device)); + }); + + it('设备扫码登录:**确认成功这一步才注册**并绑定到确认的账号,下发长期 JWT', async () => { + const fake = createFakeRedis(); + mock(app, 'redis', fake.client); + const updates = []; + let created = null; + mockModels({ + // 库里没有这个 SN —— 设备是全新的,还没注册 + async findOne() { + return null; + }, + async create(data) { + created = Object.assign({ id: 21, status: 1 }, data); + return instance(created, updates); + }, + }); + + const { code, res } = await scanFlow({ sn: 'SN-SCAN-01' }); + const d = res.body.data; + + assert(d.status === 'confirmed', JSON.stringify(d)); + assert(d.firstTime === true, '首次应是「本次才注册」'); + assert(d.sn === 'SN-SCAN-01', `应回显设备自报的 SN:${d.sn}`); + assert(d.secret === undefined, '设备身份只看长期 JWT,不再下发密钥'); + assert(d.tokenType === 'Bearer' && d.expiresIn === app.config.jwt.deviceExpiresIn, JSON.stringify(d)); + assert(d.expiresAt && Math.abs(new Date(d.expiresAt) - Date.now() - 365 * 86400 * 1000) < 60000, `应给出到期时间:${d.expiresAt}`); + + // 记录是在「确认成功」之后才建的,而且**归属就是确认登录的人** + assert(created, '确认后应创建扫描器记录'); + assert(created.sn === 'SN-SCAN-01' && created.userId === userRow.id, JSON.stringify(created)); + assert(!('secretHash' in created), '不再写密钥字段(已不用 sn+secret 那套)'); + assert(created.lastRegisterAt instanceof Date && created.lastSeenAt instanceof Date, JSON.stringify(created)); + assert(created.tokenJti, '创建后要写 jti(可用于撤销)'); + + // 下发的是**长期**扫描器 JWT(不是 7 天的用户令牌) + const ctx = app.createAnonymousContext(); + const payload = ctx.service.jwt.verifyScanner(d.token); + assert(payload.typ === 'scanner' && payload.sn === 'SN-SCAN-01' && payload.jti, JSON.stringify(payload)); + assert(Math.round((payload.exp - payload.iat) / 86400) === 365, `应为 365 天:${payload}`); + assert(ctx.service.jwt.verifyUser(d.token) === null, '长期令牌不能被当成用户令牌用'); + + // 同时返回设备信息与用户信息 + assert(d.scanner.userId === userRow.id && d.scanner.sn === 'SN-SCAN-01', JSON.stringify(d.scanner)); + assert(d.user.id === userRow.id && d.user.username === 'admin', JSON.stringify(d.user)); + + // 没带 SN 的设备也能用:服务端生成一个 SN 返回(设备存下来) + const auto = await scanFlow({}); + assert(/^DEV-[0-9A-F]{12}$/.test(auto.res.body.data.sn), `应生成 SN:${auto.res.body.data.sn}`); + + // 登录码一次性 + assert(!(await fake.client.get(`packs:wechat:state:${code}`)), '确认结果取走后应删除登录码'); + }); + + it('SN 已存在但无主(或曾被软删):由确认者认领/复活', async () => { + const fake = createFakeRedis(); + mock(app, 'redis', fake.client); + const updates = []; + let restored = false; + const row = { + id: 5, + sn: 'SN-OLD-01', + name: '旧名字', + status: 1, + userId: null, // 无主:等一个账号来认领 + deletedAt: new Date(), // 而且曾被删除 + restore: async () => { + restored = true; + row.deletedAt = null; + }, + }; + mockModels({ + async findOne(options) { + assert(options.paranoid === false, '要带上已删除的一起查(软删行仍占 sn 唯一键)'); + return instance(row, updates); + }, + }); + + const d = (await scanFlow({ sn: 'SN-OLD-01' })).res.body.data; + assert(d.status === 'confirmed', JSON.stringify(d)); + assert(d.firstTime === false, '已存在的记录不算首次注册'); + assert(d.secret === undefined, '不是首次注册,不应再返回密钥'); + assert(restored, '软删过的记录要复活'); + assert(updates[0].userId === userRow.id, `应认领给确认者:${JSON.stringify(updates)}`); + assert(d.scanner.id === 5 && d.scanner.userId === userRow.id, JSON.stringify(d.scanner)); + assert(d.token.split('.').length === 3, '照样换发长期令牌'); + }); + + it('SN 已绑定到别的账号:拒绝(403),不注册也不发令牌', async () => { + const fake = createFakeRedis(); + mock(app, 'redis', fake.client); + mockModels({ + async findOne() { + return instance({ id: 9, sn: 'SN-TAKEN-01', status: 1, userId: 999, secretHash: 'x' }); + }, + }); + + const { res } = await scanFlow({ sn: 'SN-TAKEN-01', expectPoll: 403 }); + assert(res.body.ok === false, JSON.stringify(res.body)); + assert(res.body.message.includes('其他账号'), JSON.stringify(res.body)); + assert(res.body.data === undefined, '不能把令牌发出去'); + }); + + it('设备被禁用(status=0):拒绝(403)', async () => { + const fake = createFakeRedis(); + mock(app, 'redis', fake.client); + mockModels({ + async findOne() { + return instance({ id: 9, sn: 'SN-OFF-01', status: 0, userId: null, secretHash: 'x' }); + }, + }); + + const { res } = await scanFlow({ sn: 'SN-OFF-01', expectPoll: 403 }); + assert(res.body.message.includes('已被禁用'), JSON.stringify(res.body)); + }); + + it('GET /api/device/login 码失效 → refreshed 换新码;wait 被 pollWait 封顶', async () => { + const fake = createFakeRedis(); + mock(app, 'redis', fake.client); + mockModels({}); + mock(app.config.wechat, 'pollWait', 1); // 把上限压到 1s,免得用例等 60s + + // 不存在的码 → 立即给一张新码(设备直接换二维码继续轮询) + let res = await app.httpRequest().get('/api/device/login?sn=SN-SCAN-01&code=ZZZZZZ').expect(200); + const fresh = res.body.data.code; + assert(res.body.data.status === 'refreshed', JSON.stringify(res.body)); + assert(/^[0-9A-Z]{6}$/.test(fresh) && fresh !== 'ZZZZZZ', `应换一张新码:${fresh}`); + assert(res.body.data.qrContent.endsWith(`/wechat?spm=1.0.${fresh}.1`), res.body.data.qrContent); + assert(res.body.data.device.sn === 'SN-SCAN-01', '换码时也要回显设备信息'); + assert(await fake.client.get(`packs:wechat:state:${fresh}`) === 'pending', '新码应已登记'); + + // 挂着没人扫 → 等满上限后同样换新码 + const started = Date.now(); + res = await app.httpRequest().get(`/api/device/login?code=${fresh}&wait=999`).expect(200); + const cost = Date.now() - started; + assert(res.body.data.status === 'refreshed' && res.body.data.waited === 1, JSON.stringify(res.body.data)); + assert(cost >= 900 && cost < 5000, `应等满 1s 上限(实测 ${cost}ms)`); + assert(res.body.data.code !== fresh, '应换一张新码'); + + // 码格式不对 → 422 + res = await app.httpRequest().get('/api/device/login?code=abc').expect(422); + assert(res.body.message.includes('6 位'), JSON.stringify(res.body)); + }); + + it('设备信息暂存:发码时带上、轮询时不用补齐,确认/换码都会沿用', async () => { + const fake = createFakeRedis(); + mock(app, 'redis', fake.client); + const updates = []; + let created = null; + mockModels({ + async findOne() { + return null; + }, + async create(data) { + created = Object.assign({ id: 31, status: 1 }, data); + return instance(created, updates); + }, + }); + + // ① 只在发码时带 sn + name + const issued = await app.httpRequest() + .get(`/api/device/login?sn=SN-STASH-01&name=${encodeURIComponent('暂存名字')}`) + .expect(200); + const code = issued.body.data.code; + assert(await fake.client.get(`packs:device:info:${code}`), '发码时应暂存设备信息'); + + // ② 换码(refreshed)时信息要跟着走到新码上(把 pollWait 压到 1s 触发换码) + mock(app.config.wechat, 'pollWait', 1); + const refreshed = await app.httpRequest().get(`/api/device/login?code=${code}&wait=1`).expect(200); + const newCode = refreshed.body.data.code; + assert(refreshed.body.data.status === 'refreshed', JSON.stringify(refreshed.body.data)); + assert(refreshed.body.data.device.sn === 'SN-STASH-01' && refreshed.body.data.device.name === '暂存名字', JSON.stringify(refreshed.body.data.device)); + assert(await fake.client.get(`packs:device:info:${newCode}`), '换码后信息应存到新码上'); + + // ③ 轮询**什么都不带**,确认后建出来的记录仍然带 sn 与名字 + const polled = app.httpRequest().get(`/api/device/login?code=${newCode}&wait=10`).expect(200); + await sleep(150); + await app.httpRequest() + .post('/api/wechat/confirm') + .set('Authorization', `Bearer ${userJwt()}`) + .send({ code: newCode }) + .expect(200); + + const d = (await polled).body.data; + assert(d.status === 'confirmed' && d.firstTime === true, JSON.stringify(d)); + assert(created.sn === 'SN-STASH-01' && created.name === '暂存名字', `应沿用暂存信息:${JSON.stringify(created)}`); + assert(!(await fake.client.get(`packs:device:info:${newCode}`)), '取走后应删除暂存'); + }); + + it('二维码地址:没配 SITE_URL 用请求的 origin,配了就优先用配置的域名', async () => { + const fake = createFakeRedis(); + mock(app, 'redis', fake.client); + mockModels({}); + + let d = (await app.httpRequest().get('/api/device/login').expect(200)).body.data; + assert(/^https?:\/\//.test(d.origin) && d.qrContent === `${d.origin}/wechat?spm=1.0.${d.code}.1`, JSON.stringify(d)); + + mock(app.config.email, 'siteUrl', 'https://pack.example.com/'); + d = (await app.httpRequest().get('/api/device/login').expect(200)).body.data; + assert(d.origin === 'https://pack.example.com', `尾部斜杠应被去掉:${d.origin}`); + assert(d.qrContent === `https://pack.example.com/wechat?spm=1.0.${d.code}.1`, d.qrContent); + assert(d.qrImageUrl === `https://pack.example.com/api/wechat/qrcode.svg?code=${d.code}`, d.qrImageUrl); + }); + + it('令牌时长可调:?expiresIn=30d 按该时长下发;超上限 / 格式错返回 422', async () => { + const fake = createFakeRedis(); + mock(app, 'redis', fake.client); + mockModels({ + async findOne() { + return null; + }, + async create(data) { + return instance(Object.assign({ id: 31, status: 1 }, data)); + }, + }); + const ctx = app.createAnonymousContext(); + const spanDays = (token) => { + const p = ctx.service.jwt.verifyScanner(token); + return Math.round((p.exp - p.iat) / 86400); + }; + const run = async (sn, extra) => { + const issued = await app.httpRequest().get(`/api/device/login?sn=${sn}${extra}`).expect(200); + const code = issued.body.data.code; + const polled = app.httpRequest().get(`/api/device/login?sn=${sn}${extra}&code=${code}&wait=10`).expect(200); + await sleep(150); + await app.httpRequest() + .post('/api/wechat/confirm') + .set('Authorization', `Bearer ${userJwt()}`) + .send({ code }) + .expect(200); + return (await polled).body.data; + }; + + // ① 不传 → 用服务端配置(默认 365d) + const base = await run('SN-DUR-01', ''); + assert(base.expiresIn === app.config.jwt.deviceExpiresIn && spanDays(base.token) === 365, JSON.stringify(base)); + assert(Math.abs(new Date(base.expiresAt) - Date.now() - 365 * 86400 * 1000) < 60000, base.expiresAt); + + // ② 申请更短的 30d → 下发的 JWT 就按 30 天 + const shorter = await run('SN-DUR-02', '&expiresIn=30d'); + assert(shorter.expiresIn === '30d' && spanDays(shorter.token) === 30, JSON.stringify(shorter)); + assert(Math.abs(new Date(shorter.expiresAt) - Date.now() - 30 * 86400 * 1000) < 60000, shorter.expiresAt); + + // ③ 秒数写法 3600 + const seconds = await run('SN-DUR-03', '&expiresIn=3600'); + assert(seconds.expiresIn === 3600, JSON.stringify(seconds)); + const payload = ctx.service.jwt.verifyScanner(seconds.token); + assert(payload.exp - payload.iat === 3600, `应按 3600s 签发:${payload.exp - payload.iat}`); + + // ④ 超过服务端上限 → 422(连码都不发):不允许单个设备自己把令牌拉长 + let res = await app.httpRequest().get('/api/device/login?sn=SN-DUR-04&expiresIn=999d').expect(422); + assert(res.body.message.includes('不能超过服务端上限'), JSON.stringify(res.body)); + + // ⑤ 格式不对 → 422 + res = await app.httpRequest().get('/api/device/login?sn=SN-DUR-05&expiresIn=abc').expect(422); + assert(res.body.message.includes('格式不对'), JSON.stringify(res.body)); + + // ⑥ 服务端配置改小(DEVICE_JWT_EXPIRES=10d):默认值与上限一起变 + mock(app.config.jwt, 'deviceExpiresIn', '10d'); + const ten = await run('SN-DUR-06', ''); + assert(ten.expiresIn === '10d' && spanDays(ten.token) === 10, JSON.stringify(ten)); + await app.httpRequest().get('/api/device/login?sn=SN-DUR-07&expiresIn=30d').expect(422); + }); + + it('设备长轮询:客户端断开后立刻停止等待(不换码、释放订阅连接)', async () => { + const fake = createFakeRedis(); + mock(app, 'redis', fake.client); + mockModels({}); + + const issued = await app.httpRequest().get('/api/device/login?sn=SN-SCAN-01').expect(200); + const code = issued.body.data.code; + assert(await fake.client.get(`packs:wechat:state:${code}`) === 'pending'); + + // 自己起一个真实监听端口,手动发请求再 destroy(设备重启/切页就是这样) + const server = http.createServer(app.callback()).listen(0); + await new Promise(resolve => server.once('listening', resolve)); + const port = server.address().port; + + const request = http.request({ + host: '127.0.0.1', + port, + method: 'GET', + path: `/api/device/login?sn=SN-SCAN-01&code=${code}&wait=60`, + }); + request.on('error', () => {}); // abort 后本地也会报错,忽略 + request.end(); + await sleep(300); + assert(fake.activeSubscribers() === 1, '长轮询应该还挂着(1 个订阅连接)'); + + const started = Date.now(); + request.destroy(); // 设备断开 + await sleep(300); + + assert(fake.activeSubscribers() === 0, '断开后应立刻释放订阅连接(说明没等满 60s)'); + assert(Date.now() - started < 5000, '不应等满 wait'); + assert(await fake.client.get(`packs:wechat:state:${code}`) === 'pending', '断开时不应把登录码换掉'); + + await new Promise(resolve => server.close(resolve)); + }); +}); diff --git a/backend/test/app/controller/health.test.js b/backend/test/app/controller/health.test.js new file mode 100644 index 0000000..cb697c4 --- /dev/null +++ b/backend/test/app/controller/health.test.js @@ -0,0 +1,51 @@ +'use strict'; + +const { app, mock } = require('egg-mock/bootstrap'); +const createFakeRedis = require('../../utils/fake-redis'); + +describe('test/app/controller/health.test.js', () => { + beforeEach(() => { + mock(app, 'redis', createFakeRedis().client); + }); + + it('MySQL 与 Redis 正常时返回 200', async () => { + mock(app, 'model', { + async authenticate() { + return true; + }, + }); + + const res = await app.httpRequest().get('/health').expect(200); + if (res.body.ok !== true) throw new Error('health 应为 ok'); + if (res.body.dependencies.mysql.ok !== true) throw new Error('mysql 应可用'); + if (res.body.dependencies.redis.ok !== true) throw new Error('redis 应可用'); + }); + + it('MySQL 不可用时返回 503', async () => { + mock(app, 'model', { + async authenticate() { + throw new Error("Access denied for user 'packservice'@'localhost'"); + }, + }); + + const res = await app.httpRequest().get('/health').expect(503); + if (res.body.dependencies.mysql.ok !== false) throw new Error('mysql 应标记为不可用'); + }); + + it('Redis 不可用时返回 503', async () => { + mock(app, 'model', { + async authenticate() { + return true; + }, + }); + mock(app, 'redis', { + async ping() { + throw new Error('NOAUTH Authentication required.'); + }, + }); + + const res = await app.httpRequest().get('/health').expect(503); + if (res.body.ok !== false) throw new Error('health 应为 ok:false'); + if (res.body.dependencies.redis.ok !== false) throw new Error('redis 应标记为不可用'); + }); +}); diff --git a/backend/test/app/controller/home.test.js b/backend/test/app/controller/home.test.js new file mode 100644 index 0000000..d0f7ec4 --- /dev/null +++ b/backend/test/app/controller/home.test.js @@ -0,0 +1,11 @@ +'use strict'; + +const { app, assert } = require('egg-mock/bootstrap'); + +describe('test/app/controller/home.test.js', () => { + it('GET /api/info 返回服务信息', async () => { + const res = await app.httpRequest().get('/api/info').expect(200); + assert(res.body.ok === true); + assert(typeof res.body.env === 'string'); + }); +}); diff --git a/backend/test/app/controller/internal.test.js b/backend/test/app/controller/internal.test.js new file mode 100644 index 0000000..5f6e6ba --- /dev/null +++ b/backend/test/app/controller/internal.test.js @@ -0,0 +1,73 @@ +'use strict'; + +const { app, mock, assert } = require('egg-mock/bootstrap'); +const { HEADER: INTERNAL } = require('../../utils/internal'); + +const instance = (data) => Object.assign({ toJSON: () => data }, data); + +/** + * 内部(运维)接口的鉴权:`config.internal` + * + * 允许两种方式:运维令牌(`X-Internal-Token`)或**管理员账号**的 user JWT(userId 在白名单里)。 + * 用户端接口(`/api/web/*`)与这里完全隔离:普通用户令牌调内部接口一律 403,设备令牌一律 401。 + */ +describe('test/app/controller/internal.test.js', () => { + const user = { id: 1, username: 'admin', nickname: '管理员', status: 1 }; + + const signUser = id => `Bearer ${app.createAnonymousContext().service.jwt.signUser({ id, username: `u${id}` })}`; + + it('运维令牌(X-Internal-Token)可直接访问内部接口', async () => { + mock(app, 'model', { + SysConfig: { + async findAll() { return [ instance({ configKey: 'appid', configValue: 'wx123' }) ]; }, + }, + }); + + const res = await app.httpRequest().get('/api/configs?group=wechat').set(INTERNAL).expect(200); + assert(res.body.data.total === 1, JSON.stringify(res.body)); + }); + + it('管理员账号的 user JWT 也能访问(白名单 INTERNAL_ADMIN_IDS,默认 [1])', async () => { + mock(app, 'model', { + User: { + async findByPk() { return instance(user); }, + async findAndCountAll() { return { rows: [ instance(user) ], count: 1 }; }, + }, + }); + + const res = await app.httpRequest().get('/api/users').set('Authorization', signUser(1)).expect(200); + assert(res.body.data.total === 1, JSON.stringify(res.body)); + }); + + it('没令牌 → 401;普通用户令牌 → 403;设备令牌 → 401', async () => { + mock(app, 'model', { + User: { async findByPk() { return instance({ id: 2, status: 1, username: 'other' }); } }, + }); + + const res = await app.httpRequest().get('/api/users').expect(401); + assert(res.body.status === 'unauthorized' && res.body.ok === false, JSON.stringify(res.body)); + + await app.httpRequest().get('/api/users').set('Authorization', signUser(2)).expect(403); + + // 设备令牌(typ=scanner)不是用户令牌 → 401 + const deviceToken = app.createAnonymousContext().service.jwt.signScanner({ id: 11, sn: 'SN-1' }, { jti: 'j-1' }); + await app.httpRequest().get('/api/users').set('Authorization', `Bearer ${deviceToken}`).expect(401); + }); + + it('内部令牌配错 / 为空时一律不认(fail closed)', async () => { + mock(app, 'model', { + User: { async findByPk() { return instance(user); } }, + }); + + await app.httpRequest().get('/api/users').set('x-internal-token', 'wrong-token').expect(401); + + // 规则:config.internal.token 为空串时,任何 token 都不通过(这里临时改配置验证) + const original = app.config.internal.token; + app.config.internal.token = ''; + try { + await app.httpRequest().get('/api/users').set(INTERNAL).expect(401); + } finally { + app.config.internal.token = original; + } + }); +}); diff --git a/backend/test/app/controller/scan.test.js b/backend/test/app/controller/scan.test.js new file mode 100644 index 0000000..a90f9a4 --- /dev/null +++ b/backend/test/app/controller/scan.test.js @@ -0,0 +1,562 @@ +'use strict'; + +const { app, mock, assert } = require('egg-mock/bootstrap'); +const jwt = require('jsonwebtoken'); +const { Op } = require('sequelize'); + +/** 假实例:update 时把字段合并回自身 */ +const instance = (data) => Object.assign( + { + toJSON: () => data, + update: async (fields) => Object.assign(data, fields), + }, + data, +); + +/** 假实例:额外回调 update 的字段(多次 update 时累积) */ +const inst = (data, onUpdate) => Object.assign( + { + toJSON: () => data, + update: async fields => { + if (onUpdate) onUpdate(fields); + Object.assign(data, fields); + return data; + }, + }, + data, +); + +/** 与服务端一致的密钥/签发者,造一个中控(扫描器)JWT */ +function signToken(payload = {}, options = {}) { + return jwt.sign( + Object.assign({ sub: '1', sn: 'SN-HUB-01', typ: 'scanner', jti: 'jti-1' }, payload), + app.config.jwt.secret, + Object.assign({ + algorithm: 'HS256', + expiresIn: '365d', + issuer: app.config.jwt.issuer, + audience: app.config.jwt.audience, + }, options), + ); +} + +function authScanner(overrides = {}) { + return Object.assign({ id: 1, sn: 'SN-HUB-01', status: 1, tokenJti: 'jti-1' }, overrides); +} + +describe('test/app/controller/scan.test.js', () => { + const token = () => `Bearer ${signToken()}`; + + it('四个扫码接口都必须带 JWT:无令牌一律 401', async () => { + await app.httpRequest().post('/api/scan/channels').send({ channels: [] }).expect(401); + await app.httpRequest().get('/api/scan/channels').expect(401); + await app.httpRequest().post('/api/scan/records').send({ records: [] }).expect(401); + await app.httpRequest().get('/api/scan/records').expect(401); + }); + + it('POST /api/scan/channels 首次上报:按 (中控, 通道 id) 建通道', async () => { + let created = null; + mock(app, 'model', { + User: {}, + Scanner: { async findByPk() { return instance(authScanner()); } }, + ScanChannel: { + async findAll() { + return []; + }, + async create(data) { + created = data; + return instance(Object.assign({ id: 9 }, data)); + }, + async update() { + return [ 1 ]; + }, + }, + }); + + const res = await app.httpRequest() + .post('/api/scan/channels') + .set('Authorization', token()) + .send({ channels: [{ channelId: '1', channelName: '1 号打包口' }] }) + .expect(200); + + assert(res.body.data.created === 1 && res.body.data.updated === 0 && res.body.data.invalid === 0); + assert(created.scannerId === 1, '通道归属当前中控'); + assert(created.channelId === '1'); + assert(created.channelName === '1 号打包口'); + assert(created.lastReportAt instanceof Date, '应记录最近上报时间'); + assert(res.body.data.channels[0].channelId === '1'); + }); + + it('POST /api/scan/channels 再次上报同通道:更新通道名(不新建)', async () => { + let args = null; + mock(app, 'model', { + User: {}, + Scanner: { async findByPk() { return instance(authScanner()); } }, + ScanChannel: { + async findAll() { + return [ instance({ id: 7, scannerId: 1, channelId: '1', channelName: '旧名字', deletedAt: null }) ]; + }, + async update(fields, options) { + args = { fields, options }; + return [ 1 ]; + }, + async create() { + throw new Error('不该新建通道'); + }, + }, + }); + + const res = await app.httpRequest() + .post('/api/scan/channels') + .set('Authorization', token()) + .send({ channelId: '1', channelName: '新名字' }) // 也支持单条上报 + .expect(200); + + assert(res.body.data.updated === 1 && res.body.data.created === 0); + assert(args.fields.channelName === '新名字'); + assert(args.fields.lastReportAt instanceof Date); + assert(args.options.where.id === 7); + assert(args.options.paranoid === false, '软删除的通道也要能更新'); + }); + + it('POST /api/scan/channels 曾软删除的通道会被复活(restore)', async () => { + let restored = null; + mock(app, 'model', { + User: {}, + Scanner: { async findByPk() { return instance(authScanner()); } }, + ScanChannel: { + async findAll() { + return [ instance({ id: 3, scannerId: 1, channelId: 'CH-2', channelName: '停用过的口', deletedAt: new Date() }) ]; + }, + async restore(options) { + restored = options; + return 1; + }, + async update() { + return [ 1 ]; + }, + }, + }); + + const res = await app.httpRequest() + .post('/api/scan/channels') + .set('Authorization', token()) + .send({ channels: [{ channelId: 'CH-2', channelName: '重新启用' }] }) + .expect(200); + + assert(res.body.data.updated === 1); + assert(restored && restored.where.id === 3, '应先 restore 复活通道'); + }); + + it('POST /api/scan/channels 同一批里重复通道只留最后一条;非法通道计入 invalid', async () => { + let created = null; + let createCount = 0; + mock(app, 'model', { + User: {}, + Scanner: { async findByPk() { return instance(authScanner()); } }, + ScanChannel: { + async findAll() { + return []; + }, + async create(data) { + created = data; + createCount++; + return instance(Object.assign({ id: 10 }, data)); + }, + async update() { + return [ 1 ]; + }, + }, + }); + + const res = await app.httpRequest() + .post('/api/scan/channels') + .set('Authorization', token()) + .send({ + channels: [ + { channelId: '1', channelName: '第一次' }, + { channelId: '1', channelName: '最后一次' }, + { channelName: '没有通道 id' }, + ], + }) + .expect(200); + + assert(createCount === 1, '同一批里同 channelId 只处理一次'); + assert(created.channelName === '最后一次', '应保留最后一次上报的名字'); + assert(res.body.data.received === 3 && res.body.data.created === 1 && res.body.data.invalid === 1); + assert(res.body.data.errors[0].message.includes('channelId')); + }); + + it('POST /api/scan/channels 空数组 / 缺参 → 422', async () => { + mock(app, 'model', { + User: {}, + Scanner: { async findByPk() { return instance(authScanner()); } }, + ScanChannel: {}, + }); + + await app.httpRequest().post('/api/scan/channels').set('Authorization', token()).send({ channels: [] }).expect(422); + await app.httpRequest().post('/api/scan/channels').set('Authorization', token()).send({}).expect(422); + }); + + it('POST /api/scan/records 首次上报:入库并刷新通道/心跳', async () => { + let rows = null; + let scannerUpdated = null; + const scanner = inst(authScanner(), fields => { scannerUpdated = Object.assign(scannerUpdated || {}, fields); }); + let channelBulk = null; + + mock(app, 'model', { + User: {}, + Scanner: { async findByPk() { return scanner; } }, + ScanChannel: { + async findAll() { + return [ { channelId: '1' } ]; // 通道已登记 + }, + async bulkCreate(items) { + channelBulk = items; + return items; + }, + async update() { + return [ 1 ]; + }, + }, + ScanRecord: { + async findAll() { + return []; + }, + async bulkCreate(items) { + rows = items; + return items; + }, + }, + }); + + const res = await app.httpRequest() + .post('/api/scan/records') + .set('Authorization', token()) + .send({ records: [{ barcode: '6901234567890', scanTime: '2026-10-16 10:20:30', channelId: '1' }] }) + .expect(200); + + assert(res.body.data.received === 1 && res.body.data.inserted === 1 && res.body.data.duplicated === 0); + assert(rows[0].scannerId === 1, '记录要归属当前中控'); + assert(rows[0].channelId === '1'); + assert(rows[0].barcode === '6901234567890'); + assert(rows[0].scanTime instanceof Date && rows[0].scanTime.getMilliseconds() === 0, '扫描时间截断到秒'); + assert(rows[0].reportedAt instanceof Date, '应记录服务端接收时间'); + assert(!channelBulk, '已登记的通道不该补建'); + assert(scannerUpdated && scannerUpdated.lastSeenAt instanceof Date, '上报即视为心跳'); + }); + + it('POST /api/scan/records 时间格式:支持 13 位 / 10 位时间戳,非法时间计入 invalid', async () => { + let rows = null; + mock(app, 'model', { + User: {}, + Scanner: { async findByPk() { return instance(authScanner()); } }, + ScanChannel: { + async findAll() { return [ { channelId: '1' } ]; }, + async bulkCreate(items) { return items; }, + async update() { return [ 1 ]; }, + }, + ScanRecord: { + async findAll() { return []; }, + async bulkCreate(items) { + rows = items; + return items; + }, + }, + }); + + const res = await app.httpRequest() + .post('/api/scan/records') + .set('Authorization', token()) + .send({ + records: [ + { barcode: 'A', scanTime: 1792137600000, channelId: '1' }, // 13 位毫秒 + { barcode: 'B', scanTime: 1792137600, channelId: '1' }, // 10 位秒 + { barcode: 'C', scanTime: '不是时间', channelId: '1' }, + { barcode: 'D', scanTime: '2026-10-16T10:20:30', channelId: '1' }, + ], + }) + .expect(200); + + assert(rows.length === 3, '合法时间入库 3 条'); + assert(res.body.data.invalid === 1 && res.body.data.errors[0].message.includes('scanTime')); + assert(rows[0].scanTime.getTime() === 1792137600000); + assert(rows[1].scanTime.getTime() === 1792137600000); + }); + + it('POST /api/scan/records 库里已存在 → 不入库、duplicated +1', async () => { + let inserted = false; + mock(app, 'model', { + User: {}, + Scanner: { async findByPk() { return instance(authScanner()); } }, + ScanChannel: { + async findAll() { return [ { channelId: '1' } ]; }, + async bulkCreate(items) { return items; }, + async update() { return [ 1 ]; }, + }, + ScanRecord: { + async findAll() { + return [ { scannerId: 1, channelId: '1', barcode: 'X1', scanTime: new Date('2026-10-16T10:00:00') } ]; + }, + async bulkCreate() { + inserted = true; + return []; + }, + }, + }); + + const res = await app.httpRequest() + .post('/api/scan/records') + .set('Authorization', token()) + .send({ records: [{ barcode: 'X1', scanTime: '2026-10-16 10:00:00', channelId: '1' }] }) + .expect(200); + + assert(res.body.data.inserted === 0 && res.body.data.duplicated === 1); + assert(!inserted, '完全相同的记录不应再次入库'); + }); + + it('POST /api/scan/records 同一批内重复只入库一次', async () => { + let rows = null; + mock(app, 'model', { + User: {}, + Scanner: { async findByPk() { return instance(authScanner()); } }, + ScanChannel: { + async findAll() { return [ { channelId: '1' } ]; }, + async bulkCreate(items) { return items; }, + async update() { return [ 1 ]; }, + }, + ScanRecord: { + async findAll() { return []; }, + async bulkCreate(items) { + rows = items; + return items; + }, + }, + }); + + const res = await app.httpRequest() + .post('/api/scan/records') + .set('Authorization', token()) + .send({ + records: [ + { barcode: 'A1', scanTime: '2026-10-16 10:00:00', channelId: '1' }, + { barcode: 'A1', scanTime: '2026-10-16 10:00:00', channelId: '1' }, + ], + }) + .expect(200); + + assert(rows.length === 1, '同批重复只留一条'); + assert(res.body.data.received === 2 && res.body.data.inserted === 1 && res.body.data.duplicated === 1); + }); + + it('POST /api/scan/records 未知通道自动补建(通道名留空)', async () => { + let channelRows = null; + mock(app, 'model', { + User: {}, + Scanner: { async findByPk() { return instance(authScanner()); } }, + ScanChannel: { + async findAll() { return []; }, // 通道从未登记 + async bulkCreate(items) { + channelRows = items; + return items; + }, + async update() { return [ 1 ]; }, + }, + ScanRecord: { + async findAll() { return []; }, + async bulkCreate(items) { return items; }, + }, + }); + + const res = await app.httpRequest() + .post('/api/scan/records') + .set('Authorization', token()) + .send({ records: [{ barcode: 'B1', scanTime: '2026-10-16 11:00:00', channelId: '9' }] }) + .expect(200); + + assert(res.body.data.unknownChannels.length === 1 && res.body.data.unknownChannels[0] === '9'); + assert(channelRows[0].channelId === '9' && channelRows[0].channelName === ''); + assert(channelRows[0].scannerId === 1); + }); + + it('POST /api/scan/records 唯一键冲突(并发重复)→ 退化成逐条插入,重复计数', async () => { + let createCount = 0; + mock(app, 'model', { + User: {}, + Scanner: { async findByPk() { return instance(authScanner()); } }, + ScanChannel: { + async findAll() { return [ { channelId: '1' } ]; }, + async bulkCreate(items) { return items; }, + async update() { return [ 1 ]; }, + }, + ScanRecord: { + async findAll() { return []; }, + async bulkCreate() { + const err = new Error('Duplicate entry'); + err.name = 'SequelizeUniqueConstraintError'; + throw err; + }, + async create() { + createCount++; + if (createCount === 1) { + const err = new Error('Duplicate entry'); + err.parent = { code: 'ER_DUP_ENTRY' }; + throw err; + } + return {}; + }, + }, + }); + + const res = await app.httpRequest() + .post('/api/scan/records') + .set('Authorization', token()) + .send({ + records: [ + { barcode: 'C1', scanTime: '2026-10-16 12:00:00', channelId: '1' }, + { barcode: 'C2', scanTime: '2026-10-16 12:00:01', channelId: '1' }, + ], + }) + .expect(200); + + assert(res.body.data.inserted === 1 && res.body.data.duplicated === 1); + }); + + it('POST /api/scan/records 全部非法 / 空数组 → 分别返回 invalid 与 422', async () => { + mock(app, 'model', { + User: {}, + Scanner: { async findByPk() { return instance(authScanner()); } }, + ScanChannel: {}, + ScanRecord: {}, + }); + + const res = await app.httpRequest() + .post('/api/scan/records') + .set('Authorization', token()) + .send({ records: [{ channelId: '1' }] }) // 缺条码与时间 + .expect(200); + assert(res.body.data.inserted === 0 && res.body.data.invalid === 1); + + await app.httpRequest().post('/api/scan/records').set('Authorization', token()).send({ records: [] }).expect(422); + }); + + it('POST /api/scan/records 支持 JSON 字符串形式的上报体', async () => { + let rows = null; + mock(app, 'model', { + User: {}, + Scanner: { async findByPk() { return instance(authScanner()); } }, + ScanChannel: { + async findAll() { return [ { channelId: '1' } ]; }, + async bulkCreate(items) { return items; }, + async update() { return [ 1 ]; }, + }, + ScanRecord: { + async findAll() { return []; }, + async bulkCreate(items) { + rows = items; + return items; + }, + }, + }); + + await app.httpRequest() + .post('/api/scan/records') + .set('Authorization', token()) + .send({ records: JSON.stringify([{ barcode: 'S1', scanTime: '2026-10-16 13:00:00', channelId: '1' }]) }) + .expect(200); + + assert(rows.length === 1 && rows[0].barcode === 'S1'); + }); + + it('GET /api/scan/channels 只返回当前中控的通道', async () => { + let options = null; + mock(app, 'model', { + User: {}, + Scanner: { + async findByPk() { return instance(authScanner()); }, + async findAll() { return []; }, + }, + ScanChannel: { + async findAndCountAll(opts) { + options = opts; + return { + rows: [ instance({ id: 1, scannerId: 1, channelId: '1', channelName: '1 号口', scanner: { sn: 'SN-HUB-01' } }) ], + count: 1, + }; + }, + }, + }); + + const res = await app.httpRequest().get('/api/scan/channels?pageSize=5').set('Authorization', token()).expect(200); + assert(options.where.scannerId === 1, '必须按当前中控过滤'); + assert(options.limit === 5); + assert(res.body.data.total === 1 && res.body.data.list[0].channelName === '1 号口'); + }); + + it('GET /api/scan/records 支持通道/条码/时间过滤且只查当前中控', async () => { + let options = null; + mock(app, 'model', { + User: {}, + Scanner: { + async findByPk() { return instance(authScanner()); }, + async findAll() { return []; }, + }, + ScanRecord: { + async findAndCountAll(opts) { + options = opts; + return { + rows: [ instance({ id: 3, scannerId: 1, channelId: '1', barcode: 'B1', scanTime: new Date() }) ], + count: 1, + }; + }, + }, + }); + + const res = await app.httpRequest() + .get('/api/scan/records?channelId=1&barcode=B1&startTime=2026-10-16&endTime=2026-10-17') + .set('Authorization', token()) + .expect(200); + + assert(options.where.scannerId === 1); + assert(options.where.channelId === '1'); + assert(String(options.where.barcode[Op.like]) === '%B1%'); + assert(options.where.scanTime[Op.gte] instanceof Date && options.where.scanTime[Op.lte] instanceof Date); + assert(options.order[0][0] === 'scanTime' && options.order[0][1] === 'DESC'); + assert(res.body.data.total === 1 && res.body.data.list[0].barcode === 'B1'); + }); + + it('被禁用的中控调用上报接口 → 403', async () => { + mock(app, 'model', { + User: {}, + Scanner: { async findByPk() { return instance(authScanner({ status: 0 })); } }, + ScanChannel: {}, + ScanRecord: {}, + }); + await app.httpRequest() + .post('/api/scan/channels') + .set('Authorization', token()) + .send({ channels: [{ channelId: '1' }] }) + .expect(403); + }); + + it('已被轮换的旧 JWT 调上报接口 → 401(与 scanner 接口一致)', async () => { + mock(app, 'model', { + User: {}, + Scanner: { async findByPk() { return instance(authScanner({ tokenJti: 'new-jti' })); } }, + ScanChannel: {}, + ScanRecord: {}, + }); + + const res = await app.httpRequest() + .post('/api/scan/records') + .set('Authorization', token()) + .send({ records: [{ barcode: 'A', scanTime: '2026-10-16 10:00:00', channelId: '1' }] }) + .expect(401); + assert(res.body.message.includes('已失效')); + }); + + it('老的 sn + secret 登录入口已下线(设备统一走扫码登录)', async () => { + const res = await app.httpRequest().post('/api/scanner/login').send({ sn: 'SN-HUB-01', secret: 'x' }).expect(404); + assert(res.body.ok === false && res.body.message === '接口不存在', JSON.stringify(res.body)); + }); +}); diff --git a/backend/test/app/controller/scanner.test.js b/backend/test/app/controller/scanner.test.js new file mode 100644 index 0000000..5697e88 --- /dev/null +++ b/backend/test/app/controller/scanner.test.js @@ -0,0 +1,259 @@ +'use strict'; + +const { app, mock, assert } = require('egg-mock/bootstrap'); +const jwt = require('jsonwebtoken'); +const createFakeRedis = require('../../utils/fake-redis'); +const { HEADER: INTERNAL } = require('../../utils/internal'); + +/** 管理侧接口(绑定/列表/删除)要运维令牌;设备侧接口多带这个 header 也无副作用 */ +const http = { + get: url => app.httpRequest().get(url).set(INTERNAL), + post: url => app.httpRequest().post(url).set(INTERNAL), + put: url => app.httpRequest().put(url).set(INTERNAL), + delete: url => app.httpRequest().delete(url).set(INTERNAL), +}; + +const instance = (data) => Object.assign( + { + toJSON: () => data, + update: async (fields) => Object.assign(data, fields), + }, + data, +); + +/** 假实例:update 时额外回调(用于断言写入的字段) */ +const inst = (data, onUpdate) => Object.assign( + { + toJSON: () => data, + update: async fields => { + if (onUpdate) onUpdate(fields); + Object.assign(data, fields); + return data; + }, + }, + data, +); + +/** 用与服务端一致的密钥/签发者造一个扫描器 JWT */ +function signScannerToken(payload = {}, options = {}) { + return jwt.sign( + Object.assign({ sub: '1', sn: 'SN-001', typ: 'scanner', jti: 'jti-1' }, payload), + app.config.jwt.secret, + Object.assign({ + algorithm: 'HS256', + expiresIn: '365d', + issuer: app.config.jwt.issuer, + audience: app.config.jwt.audience, + }, options), + ); +} + +describe('test/app/controller/scanner.test.js', () => { + beforeEach(() => { + mock(app, 'redis', createFakeRedis().client); + }); + + it('老的 sn + secret 注册/登录入口已下线(设备统一走扫码登录 GET /api/device/login)', async () => { + mock(app, 'model', { User: {}, Scanner: {} }); + const reg = await http.post('/api/scanner/register').send({ sn: 'SN-001' }).expect(404); + const login = await http.post('/api/scanner/login').send({ sn: 'SN-001', secret: 'x' }).expect(404); + // 接口的 404 也要是 JSON(不然客户端按 JSON 解析会报错) + assert(reg.body.ok === false && reg.body.message === '接口不存在', JSON.stringify(reg.body)); + assert(login.body.ok === false, JSON.stringify(login.body)); + }); + + it('GET /api/scanner/me 必须带 JWT:无令牌 401 / 带令牌 200', async () => { + await http.get('/api/scanner/me').expect(401); + + mock(app, 'model', { + User: {}, + Scanner: { + async findByPk(id) { + // 鉴权阶段用 payload.sub(字符串),控制器里又按主键(数字)取一次 + assert(String(id) === '1'); + return instance({ id: 1, sn: 'SN-001', status: 1, tokenJti: 'jti-1' }); + }, + }, + }); + + const res = await http + .get('/api/scanner/me') + .set('Authorization', `Bearer ${signScannerToken()}`) + .expect(200); + + assert(res.body.data.sn === 'SN-001'); + assert(res.body.data.secretHash === undefined && res.body.data.tokenJti === undefined, '不应回传密钥/jti'); + }); + + it('GET /api/scanner/me JWT 失效的各种情况', async () => { + const baseModel = { + User: {}, + Scanner: { + async findByPk() { + return instance({ id: 1, sn: 'SN-001', status: 1, tokenJti: 'jti-1' }); + }, + }, + }; + + // 签名不对 + mock(app, 'model', baseModel); + const badSign = jwt.sign({ sub: '1', sn: 'SN-001', jti: 'jti-1' }, 'wrong-secret', { + issuer: app.config.jwt.issuer, audience: app.config.jwt.audience, + }); + await http.get('/api/scanner/me').set('Authorization', `Bearer ${badSign}`).expect(401); + + // 已过期 + const expired = signScannerToken({}, { expiresIn: '-1s' }); + await http.get('/api/scanner/me').set('Authorization', `Bearer ${expired}`).expect(401); + + // jti 已被轮换 + const stale = signScannerToken({ jti: 'old-jti' }); + const staleRes = await http.get('/api/scanner/me').set('Authorization', `Bearer ${stale}`).expect(401); + assert(staleRes.body.message.includes('已失效')); + + // 扫描器被禁用 + mock(app, 'model', { + User: {}, + Scanner: { async findByPk() { return instance({ id: 1, sn: 'SN-001', status: 0, tokenJti: 'jti-1' }); } }, + }); + await http.get('/api/scanner/me').set('Authorization', `Bearer ${signScannerToken()}`).expect(403); + + // 扫描器已删除 + mock(app, 'model', { User: {}, Scanner: { async findByPk() { return null; } } }); + await http.get('/api/scanner/me').set('Authorization', `Bearer ${signScannerToken()}`).expect(401); + }); + + it('POST /api/scanner/heartbeat 用 JWT 保活并刷新心跳时间', async () => { + let updated = null; + mock(app, 'model', { + User: {}, + Scanner: { + async findByPk() { + return inst({ id: 1, sn: 'SN-001', status: 1, tokenJti: 'jti-1' }, fields => { + updated = fields; + }); + }, + }, + }); + + const res = await http + .post('/api/scanner/heartbeat') + .set('Authorization', `Bearer ${signScannerToken()}`) + .expect(200); + + assert(res.body.data.sn === 'SN-001'); + assert(typeof res.body.data.serverTime === 'string'); + assert(updated.lastSeenAt instanceof Date, '应刷新最近心跳时间'); + }); + + it('POST /api/scanner/bind 支持 sn + username 绑定', async () => { + let updated = null; + mock(app, 'model', { + User: { + async findOne() { + return instance({ id: 7, username: 'admin' }); + }, + }, + Scanner: { + async findOne() { + return inst({ id: 1, sn: 'SN-001' }, fields => { + updated = fields; + }); + }, + }, + }); + + await http + .post('/api/scanner/bind') + .send({ sn: 'SN-001', username: 'admin' }) + .expect(200); + + assert(updated.userId === 7); + }); + + it('POST /api/scanner/bind 扫描器不存在 → 404,用户不存在 → 404', async () => { + mock(app, 'model', { + User: { async findOne() { return null; } }, + Scanner: { async findOne() { return null; } }, + }); + await http.post('/api/scanner/bind').send({ sn: 'X', username: 'nobody' }).expect(404); + + mock(app, 'model', { + User: { async findOne() { return null; } }, + Scanner: { async findOne() { return instance({ id: 1, sn: 'SN-001' }); } }, + }); + const res = await http.post('/api/scanner/bind').send({ sn: 'SN-001', username: 'nobody' }).expect(404); + assert(res.body.message.includes('用户不存在')); + }); + + it('POST /api/scanner/unbind 解绑(清掉归属,保留扫描器)', async () => { + let updated = null; + mock(app, 'model', { + User: {}, + Scanner: { + async findOne() { + return inst({ id: 1, sn: 'SN-001', userId: 7 }, fields => { + updated = fields; + }); + }, + }, + }); + + await http.post('/api/scanner/unbind').send({ sn: 'SN-001' }).expect(200); + assert(updated.userId === null); + }); + + it('GET /api/scanners 分页列表(带绑定账号、不含密钥与 jti)', async () => { + mock(app, 'model', { + User: { name: 'User' }, + Scanner: { + async findAndCountAll(options) { + assert(options.limit === 5); + assert(options.offset === 5); + assert.deepStrictEqual(options.order, [[ 'id', 'DESC' ]]); + return { + rows: [ instance({ id: 1, sn: 'SN-001', name: '扫描枪', user: { id: 1, nickname: '管理员' } }) ], + count: 1, + }; + }, + }, + }); + + const res = await http.get('/api/scanners?page=2&pageSize=5').expect(200); + assert(res.body.data.total === 1); + assert(res.body.data.page === 2); + assert(res.body.data.list[0].sn === 'SN-001'); + assert(res.body.data.list[0].user.nickname === '管理员'); + assert(!JSON.stringify(res.body.data).includes('tokenJti')); + }); + + it('GET /api/scanners/:id 详情 / 不存在 404 / id 非法 400', async () => { + mock(app, 'model', { + User: {}, + Scanner: { + async findByPk() { + return instance({ id: 1, sn: 'SN-001' }); + }, + }, + }); + await http.get('/api/scanners/1').expect(200); + + mock(app, 'model', { User: {}, Scanner: { async findByPk() { return null; } } }); + await http.get('/api/scanners/1').expect(404); + await http.get('/api/scanners/abc').expect(400); + }); + + it('DELETE /api/scanners/:id 软删除扫描器', async () => { + mock(app, 'model', { + User: {}, + Scanner: { + async destroy(options) { + assert.deepStrictEqual(options.where, { id: 1 }); + return 1; + }, + }, + }); + + await http.delete('/api/scanners/1').expect(200); + }); +}); diff --git a/backend/test/app/controller/user.test.js b/backend/test/app/controller/user.test.js new file mode 100644 index 0000000..2b3f5a5 --- /dev/null +++ b/backend/test/app/controller/user.test.js @@ -0,0 +1,237 @@ +'use strict'; + +const { app, mock, assert } = require('egg-mock/bootstrap'); +const { Op } = require('sequelize'); +const createFakeRedis = require('../../utils/fake-redis'); +const { HEADER: INTERNAL } = require('../../utils/internal'); + +/** 用户 CRUD 属「内部接口」:请求都带上运维令牌 */ +const http = { + get: url => app.httpRequest().get(url).set(INTERNAL), + post: url => app.httpRequest().post(url).set(INTERNAL), + put: url => app.httpRequest().put(url).set(INTERNAL), + delete: url => app.httpRequest().delete(url).set(INTERNAL), +}; + +/** 包装成「Sequelize 实例」的样子;data 里自带的 update / toJSON 优先 */ +const instance = (data) => Object.assign( + { + toJSON: () => data, + update: async (fields) => Object.assign(data, fields), + }, + data, +); + +describe('test/app/controller/user.test.js', () => { + const row = { id: 1, username: 'zhangsan', nickname: '张三', phone: '13800000000', gender: 1, status: 1 }; + let fakeRedis; + + beforeEach(() => { + fakeRedis = createFakeRedis(); + mock(app, 'redis', fakeRedis.client); + }); + + it('GET /api/users/:id 未命中缓存时回源数据库,并写入缓存', async () => { + let queries = 0; + mock(app, 'model', { + User: { + async findByPk(id) { + queries++; + assert(id === 1); + return instance(row); + }, + }, + }); + + const res = await http.get('/api/users/1').expect(200); + assert(res.body.data.nickname === '张三'); + assert(queries === 1); + assert(fakeRedis.store.get('packs:user:1'), '详情应写入缓存'); + + // 第二次请求命中缓存,不再回源数据库 + await http.get('/api/users/1').expect(200); + assert(queries === 1); + }); + + it('Redis 不可用时详情接口降级回源数据库,不报错', async () => { + mock(app, 'redis', { + async get() { + throw new Error('connect ECONNREFUSED 127.0.0.1:6379'); + }, + async setex() { + throw new Error('connect ECONNREFUSED 127.0.0.1:6379'); + }, + }); + mock(app, 'model', { + User: { + async findByPk() { + return instance(row); + }, + }, + }); + + const res = await http.get('/api/users/1').expect(200); + assert(res.body.data.nickname === '张三'); + }); + + it('GET /api/users/:id 用户不存在时返回 404', async () => { + mock(app, 'model', { + User: { + async findByPk() { + return null; + }, + }, + }); + + await http.get('/api/users/99').expect(404); + }); + + it('GET /api/users/:id id 非法时返回 400 且不查库', async () => { + mock(app, 'model', { + User: { + async findByPk() { + assert.fail('id 非法时不应该访问数据库'); + }, + }, + }); + + await http.get('/api/users/abc').expect(400); + }); + + it('GET /api/users 支持 keyword + status 过滤与分页', async () => { + mock(app, 'model', { + User: { + async findAndCountAll(options) { + assert(options.limit === 10); + assert(options.offset === 10); + assert.deepStrictEqual(options.order, [[ 'id', 'DESC' ]]); + assert.strictEqual(options.where.status, 1); + assert.deepStrictEqual(options.where[Op.or], [ + { nickname: { [Op.like]: '%张%' } }, + { username: { [Op.like]: '%张%' } }, + { phone: { [Op.like]: '%张%' } }, + { email: { [Op.like]: '%张%' } }, + ]); + return { rows: [ instance(row) ], count: 1 }; + }, + }, + }); + + const res = await http + .get(`/api/users?page=2&pageSize=10&status=1&keyword=${encodeURIComponent('张')}`) + .expect(200); + + assert(res.body.data.total === 1); + assert(res.body.data.page === 2); + assert(res.body.data.list[0].nickname === '张三'); + }); + + it('POST /api/users 缺少 nickname 时返回 422', async () => { + await http.post('/api/users').send({ phone: '13900000000' }).expect(422); + }); + + it('POST /api/users 创建成功返回 201', async () => { + mock(app, 'model', { + User: { + async findOne() { + return null; + }, + async create(data) { + assert(data.nickname === '李四'); + assert(data.gender === 2); + return instance(Object.assign({ id: 7 }, data)); + }, + }, + }); + + const res = await http + .post('/api/users') + .send({ nickname: '李四', gender: '2' }) + .expect(201); + + assert(res.body.data.id === 7); + assert(res.body.data.gender === 2, 'gender 应归一化为数字'); + }); + + it('POST /api/users 用户名已存在时返回 409', async () => { + mock(app, 'model', { + User: { + async findOne() { + return instance(row); + }, + async create() { + assert.fail('唯一性冲突时不应该创建'); + }, + }, + }); + + const res = await http + .post('/api/users') + .send({ nickname: '张三', username: 'zhangsan' }) + .expect(409); + + // 统一错误响应中间件:4xx 也返回 JSON + assert(res.body.ok === false); + assert(res.body.message.includes('username 已存在'), '应返回冲突原因'); + }); + + it('PUT /api/users/:id 更新成功后清除该用户缓存', async () => { + fakeRedis.store.set('packs:user:1', JSON.stringify(row)); + + let updated = null; + const data = Object.assign({}, row); + mock(app, 'model', { + User: { + async findOne() { + return null; + }, + async findByPk() { + return { + update: async fields => { + updated = fields; + Object.assign(data, fields); + }, + toJSON: () => data, + }; + }, + }, + }); + + const res = await http + .put('/api/users/1') + .send({ nickname: '张三丰' }) + .expect(200); + + assert(res.body.data.nickname === '张三丰'); + assert.deepStrictEqual(updated, { nickname: '张三丰' }); + assert(!fakeRedis.store.has('packs:user:1'), '更新后缓存应失效'); + }); + + it('DELETE /api/users/:id 软删除并清除缓存', async () => { + fakeRedis.store.set('packs:user:1', JSON.stringify(row)); + + mock(app, 'model', { + User: { + async destroy(options) { + assert.deepStrictEqual(options.where, { id: 1 }); + return 1; + }, + }, + }); + + await http.delete('/api/users/1').expect(200); + assert(!fakeRedis.store.has('packs:user:1')); + }); + + it('DELETE /api/users/:id 记录不存在返回 404', async () => { + mock(app, 'model', { + User: { + async destroy() { + return 0; + }, + }, + }); + + await http.delete('/api/users/1').expect(404); + }); +}); diff --git a/backend/test/app/controller/web.data.test.js b/backend/test/app/controller/web.data.test.js new file mode 100644 index 0000000..43588c4 --- /dev/null +++ b/backend/test/app/controller/web.data.test.js @@ -0,0 +1,229 @@ +'use strict'; + +const { app, mock, assert } = require('egg-mock/bootstrap'); +const { Op } = require('sequelize'); + +/** 伪造的 sequelize 实例(toJSON + update 直接改同一份数据) */ +const instance = (data) => Object.assign( + { + toJSON: () => data, + update: async (fields) => Object.assign(data, fields), + }, + data, +); + +/** + * web 用户端的数据接口:我的设备 / 我的记录 / 我的统计 / 测试页模拟接口 + * + * 重点断言:**范围一定限定在当前用户名下**(前端传的 userId 一律忽略), + * 别人的设备一律 404(不泄露存在性)。 + */ +describe('test/app/controller/web.data.test.js', () => { + const me = { id: 1, username: 'admin', nickname: '管理员', status: 1 }; + + const token = () => `Bearer ${app.createAnonymousContext().service.jwt.signUser(me)}`; + + /** 只替换用到的模型,User 固定返回当前登录用户 */ + function mockModels(models = {}) { + mock(app, 'model', Object.assign({ + User: { async findByPk() { return instance(me); } }, + }, models)); + } + + it('GET /api/web/devices:只列自己的设备(忽略前端传的 userId)', async () => { + mockModels({ + Scanner: { + async findAndCountAll(options) { + assert(options.where.userId === 1, '必须按当前用户过滤'); + return { rows: [ instance({ id: 7, sn: 'SN-7', userId: 1 }) ], count: 1 }; + }, + }, + }); + + const res = await app.httpRequest().get('/api/web/devices?userId=2').set('Authorization', token()).expect(200); + assert(res.body.data.total === 1 && res.body.data.list[0].sn === 'SN-7', JSON.stringify(res.body)); + + // 没令牌 → 401 + await app.httpRequest().get('/api/web/devices').expect(401); + }); + + it('GET /api/web/devices/:id:别人的设备返回 404(不暴露存在性)', async () => { + mockModels({ + Scanner: { async findByPk() { return instance({ id: 9, sn: 'SN-9', userId: 2 }); } }, + }); + + await app.httpRequest().get('/api/web/devices/9').set('Authorization', token()).expect(404); + await app.httpRequest().delete('/api/web/devices/9').set('Authorization', token()).expect(404); + await app.httpRequest().post('/api/web/devices/9/unbind').set('Authorization', token()).expect(404); + }); + + it('GET /api/web/devices/:id/channels:看自己设备的通道', async () => { + let queriedId = 0; + mockModels({ + Scanner: { async findByPk() { return instance({ id: 9, sn: 'SN-9', userId: 1 }); } }, + ScanChannel: { + async findAll(options) { + queriedId = options.where.scannerId; + return [ instance({ channelId: 'CH-1', channelName: '通道一' }) ]; + }, + }, + }); + + const res = await app.httpRequest().get('/api/web/devices/9/channels').set('Authorization', token()).expect(200); + assert(queriedId === 9 && res.body.data.list[0].channelId === 'CH-1', JSON.stringify(res.body)); + }); + + it('POST /api/web/devices/:id/unbind:解绑自己的设备(清掉归属)', async () => { + let updated = null; + mockModels({ + Scanner: { + async findByPk() { + return instance({ + id: 9, + sn: 'SN-9', + userId: 1, + update: async fields => { updated = fields; }, + }); + }, + }, + }); + + await app.httpRequest().post('/api/web/devices/9/unbind').set('Authorization', token()).expect(200); + assert(updated && updated.userId === null, JSON.stringify(updated)); + }); + + it('DELETE /api/web/devices/:id:删除自己的设备(软删除)', async () => { + let destroyed = 0; + mockModels({ + Scanner: { + async findByPk() { return instance({ id: 9, sn: 'SN-9', userId: 1 }); }, + async destroy({ where }) { destroyed = where.id; return 1; }, + }, + }); + + await app.httpRequest().delete('/api/web/devices/9').set('Authorization', token()).expect(200); + assert(destroyed === 9); + }); + + it('GET /api/web/records:只查自己设备的记录(deviceId 越权 404)', async () => { + let seenWhere = null; + mockModels({ + Scanner: { + async findAll() { return [ { id: 1 }, { id: 2 } ]; }, + async findByPk() { return instance({ id: 1, sn: 'SN-1', userId: 1 }); }, + }, + ScanRecord: { + async findAndCountAll(options) { + seenWhere = options.where; + return { + rows: [ instance({ id: 5, barcode: '6901', channelId: 'CH-1', scanTime: new Date(), scanner: { sn: 'SN-1' } }) ], + count: 1, + }; + }, + }, + }); + + const res = await app.httpRequest().get('/api/web/records?barcode=6901').set('Authorization', token()).expect(200); + assert(seenWhere.scannerId[Op.in].join(',') === '1,2', '应限定在自己的设备范围内'); + assert(res.body.data.list[0].deviceSn === 'SN-1', JSON.stringify(res.body.data.list[0])); + + // 只查其中一台(自己名下)→ 范围收窄成那一台 + await app.httpRequest().get('/api/web/records?deviceId=2').set('Authorization', token()).expect(200); + assert(seenWhere.scannerId[Op.in].join(',') === '2', '指定自己名下的设备时应只查这一台'); + + // 别人的设备 id(100)→ 404 + await app.httpRequest().get('/api/web/records?deviceId=100').set('Authorization', token()).expect(404); + }); + + it('GET /api/web/stats:设备/通道/记录数都限定在当前用户范围内', async () => { + const wanted = []; + mockModels({ + Scanner: { + async findAll() { return [ { id: 3 }, { id: 4 } ]; }, + async count({ where }) { + assert(where.userId === 1); + return 2; + }, + }, + ScanChannel: { + async count({ where }) { wanted.push(where.scannerId[Op.in].join(',')); return 5; }, + }, + ScanRecord: { + async count({ where }) { wanted.push(where.scannerId[Op.in].join(',')); return 9; }, + async findAndCountAll() { return { rows: [], count: 0 }; }, + }, + }); + + const res = await app.httpRequest().get('/api/web/stats').set('Authorization', token()).expect(200); + assert(res.body.data.deviceCount === 2 && res.body.data.channelCount === 5 && res.body.data.recordCount === 9, JSON.stringify(res.body)); + assert(wanted.every(item => item === '3,4'), `统计范围应限定在自己的设备: ${wanted.join('|')}`); + }); + + it('POST /api/web/test/device-login:以当前用户为确认人建/取设备并发长期令牌', async () => { + let created = null; + mockModels({ + Scanner: { + async findOne() { return null; }, + async create(data) { + created = data; + return instance(Object.assign({ id: 11 }, data)); + }, + async findByPk() { + return instance({ id: 11, sn: 'SN-TEST-01', userId: 1, tokenJti: 'j-1', status: 1 }); + }, + }, + }); + + const res = await app.httpRequest() + .post('/api/web/test/device-login') + .set('Authorization', token()) + .send({ sn: 'SN-TEST-01', name: '测试中控', vendor: 'ACME' }) + .expect(200); + + assert(created.userId === 1 && created.sn === 'SN-TEST-01' && created.vendor === 'ACME', JSON.stringify(created)); + assert(res.body.data.firstTime === true && res.body.data.tokenType === 'Bearer' && res.body.data.token, JSON.stringify(res.body.data)); + const payload = app.createAnonymousContext().service.jwt.verifyScanner(res.body.data.token); + assert(payload.typ === 'scanner' && Number(payload.sub) === 11, JSON.stringify(payload)); + }); + + it('POST /api/web/test/scan:用设备 SN + 长期 JWT 走完整校验(含 jti 比对)', async () => { + const sign = (extra = {}) => app.createAnonymousContext().service.jwt.signScanner( + { id: 11, sn: 'SN-TEST-01' }, Object.assign({ jti: 'j-1' }, extra), + ); + const scannerRow = () => instance({ + id: 11, sn: 'SN-TEST-01', userId: 1, status: 1, tokenJti: 'j-1', + }); + let inserted = 0; + mockModels({ + Scanner: { async findByPk() { return scannerRow(); } }, + ScanChannel: { + async findAll() { return []; }, + async create({ channelId, channelName }) { return instance({ id: 3, channelId, channelName }); }, + async bulkCreate() {}, + async update() {}, + }, + ScanRecord: { + async findAll() { return []; }, + async bulkCreate(rows) { inserted = rows.length; }, + }, + }); + + const res = await app.httpRequest() + .post('/api/web/test/scan') + .set('Authorization', token()) + .send({ sn: 'SN-TEST-01', token: sign(), channelId: 'CH-9', barcode: '6901234567892' }) + .expect(200); + + assert(inserted === 1 && res.body.data.inserted === 1, JSON.stringify(res.body)); + + // SN 对不上 → 401;jti 过期(重新登录过)→ 401 + await app.httpRequest().post('/api/web/test/scan').set('Authorization', token()) + .send({ sn: 'SN-OTHER', token: sign(), channelId: 'CH-9', barcode: 'x' }).expect(401); + await app.httpRequest().post('/api/web/test/scan').set('Authorization', token()) + .send({ sn: 'SN-TEST-01', token: sign({ jti: 'j-old' }), channelId: 'CH-9', barcode: 'x' }).expect(401); + + // 用户令牌不能当设备令牌用 + await app.httpRequest().post('/api/web/test/scan').set('Authorization', token()) + .send({ sn: 'SN-TEST-01', token: token().replace('Bearer ', ''), channelId: 'CH-9', barcode: 'x' }).expect(401); + }); +}); diff --git a/backend/test/app/controller/web.test.js b/backend/test/app/controller/web.test.js new file mode 100644 index 0000000..4ada1c9 --- /dev/null +++ b/backend/test/app/controller/web.test.js @@ -0,0 +1,137 @@ +'use strict'; + +const { app, mock, assert } = require('egg-mock/bootstrap'); +const bcrypt = require('bcryptjs'); +const jwt = require('jsonwebtoken'); +const createFakeRedis = require('../../utils/fake-redis'); + +const instance = (data) => Object.assign( + { + toJSON: () => data, + update: async (fields) => Object.assign(data, fields), + }, + data, +); + +describe('test/app/controller/web.test.js', () => { + const passwordHash = bcrypt.hashSync('secret-pass', 4); + const userRow = { + id: 1, + username: 'admin', + nickname: '管理员', + email: 'admin@example.com', + phone: '13800000001', + status: 1, + passwordHash, + }; + + /** 用户模型:按账号查 / 按主键查 */ + function mockUser(user = userRow) { + mock(app, 'model', { + User: { + async findOne() { + return instance(Object.assign({}, user, { update: async fields => Object.assign(user, fields) })); + }, + async findByPk(id) { + return instance(Object.assign({}, user, { id })); + }, + }, + }); + } + + it('POST /api/web/auth/login:账号密码换取 user JWT(不依赖 cookie/CSRF)', async () => { + mock(app, 'redis', createFakeRedis().client); + mockUser(); + + const res = await app.httpRequest() + .post('/api/web/auth/login') + .send({ account: 'admin', password: 'secret-pass' }) + .expect(200); + + assert(res.body.ok === true, JSON.stringify(res.body)); + const { token, tokenType, expiresIn, user } = res.body.data; + assert(tokenType === 'Bearer' && expiresIn === app.config.jwt.userExpiresIn, JSON.stringify(res.body.data)); + assert(user.id === 1 && user.username === 'admin' && user.passwordHash === undefined, JSON.stringify(user)); + + const payload = jwt.decode(token); + assert(payload.typ === 'user' && Number(payload.sub) === 1, JSON.stringify(payload)); + assert(!(res.headers['set-cookie'] || []).some(item => item.startsWith('packs_sess')), '不应下发登录态 cookie'); + }); + + it('POST /api/web/auth/login:密码错 / 缺参', async () => { + mock(app, 'redis', createFakeRedis().client); + mockUser(); + + let res = await app.httpRequest().post('/api/web/auth/login').send({ account: 'admin', password: 'wrong' }).expect(401); + assert(res.body.status === 'unauthorized' && res.body.message.includes('账号或密码错误'), JSON.stringify(res.body)); + + res = await app.httpRequest().post('/api/web/auth/login').send({ account: 'admin' }).expect(422); + assert(res.body.ok === false, JSON.stringify(res.body)); + }); + + it('GET /api/web/me / PUT /api/web/me / PUT /api/web/me/password:都按令牌里的用户操作', async () => { + mock(app, 'redis', createFakeRedis().client); + let updated = null; + /** ⚠️ mock 会忽略 attributes.exclude,这里手动模拟 service 的 SAFE_ATTRIBUTES(不吐密码哈希) */ + const safeRow = () => { + const { passwordHash: _omit, ...safe } = userRow; + return safe; + }; + mock(app, 'model', { + User: { + // 真 service 的行为:默认不返回密码哈希,只有显式 include('passwordHash') 时才带 + async findByPk(id, options) { + assert(String(id) === '1'); + const wantHash = Boolean(options?.attributes?.include?.includes('passwordHash')); + const data = wantHash ? Object.assign({}, userRow) : safeRow(); + const row = instance(data); + // update 要同时写进实例的 toJSON 数据,否则控制器回显还是旧值 + row.update = async fields => { + updated = Object.assign(updated || {}, fields); + Object.assign(data, fields); + Object.assign(userRow, fields); + }; + return row; + }, + }, + }); + + const token = app.createAnonymousContext().service.jwt.signUser(userRow); + const auth = { Authorization: `Bearer ${token}` }; + + let res = await app.httpRequest().get('/api/web/me').set(auth).expect(200); + assert(res.body.data.username === 'admin' && res.body.data.passwordHash === undefined, JSON.stringify(res.body.data)); + await app.httpRequest().get('/api/web/me').expect(401); + + res = await app.httpRequest().put('/api/web/me').set(auth).send({ nickname: '新昵称' }).expect(200); + assert(res.body.data.nickname === '新昵称' && updated.nickname === '新昵称', JSON.stringify(updated)); + + // 改密码:原密码错 → 422;正确 → 200 + await app.httpRequest().put('/api/web/me/password').set(auth).send({ oldPassword: 'nope', newPassword: 'new-pass' }).expect(422); + await app.httpRequest().put('/api/web/me/password').set(auth).send({ oldPassword: 'secret-pass', newPassword: 'new-pass' }).expect(200); + assert(await bcrypt.compare('new-pass', userRow.passwordHash), '应写入新密码哈希'); + }); + + it('POST /api/web/auth/forgot:邮箱未注册也返回成功(防账号枚举)', async () => { + mock(app, 'redis', createFakeRedis().client); + mock(app, 'model', { + User: { async findOne() { return null; } }, + }); + + const res = await app.httpRequest().post('/api/web/auth/forgot').send({ email: 'nobody@example.com' }).expect(200); + assert(res.body.data.sent === true && res.body.data.url === undefined, JSON.stringify(res.body)); + + await app.httpRequest().post('/api/web/auth/forgot').send({ email: 'bad' }).expect(422); + }); + + it('GET /api/wechat/qrcode.svg:本地生成二维码(可直接给前端 img 用)', async () => { + mock(app, 'redis', createFakeRedis().client); + + const res = await app.httpRequest().get('/api/wechat/qrcode.svg?code=AB12CD').expect(200); + assert(String(res.headers['content-type']).includes('image/svg+xml'), res.headers['content-type']); + // SVG 是二进制类响应,supertest 可能只给 res.body(Buffer) + const svg = res.text || String(res.body); + assert(svg.includes(' app.httpRequest().get(url).set(INTERNAL), + post: url => app.httpRequest().post(url).set(INTERNAL), + put: url => app.httpRequest().put(url).set(INTERNAL), + delete: url => app.httpRequest().delete(url).set(INTERNAL), +}; + +const instance = (data) => Object.assign( + { + toJSON: () => data, + update: async (fields) => Object.assign(data, fields), + }, + data, +); + +describe('test/app/controller/wechat.test.js', () => { + beforeEach(() => { + mock(app, 'redis', createFakeRedis().client); + }); + + it('POST /api/wechat/bind 首次绑定创建记录(201)', async () => { + mock(app, 'model', { + WechatOauth: { + async findOne() { + return null; + }, + async create(data) { + assert(data.userId === 1); + assert(data.appid === 'wx123'); + assert(data.openid === 'o_abc'); + assert(data.lastAuthAt instanceof Date, '应记录最近授权时间'); + return instance(Object.assign({ id: 9 }, data)); + }, + }, + }); + + const res = await http + .post('/api/wechat/bind') + .send({ userId: 1, appid: 'wx123', openid: 'o_abc', nickname: '微信昵称' }) + .expect(201); + + assert(res.body.data.id === 9); + assert(res.body.data.nickname === '微信昵称'); + }); + + it('POST /api/wechat/bind 已存在时更新(含换绑用户)', async () => { + let updated = null; + mock(app, 'model', { + WechatOauth: { + async findOne() { + return instance({ + id: 9, + userId: 1, + appid: 'wx123', + openid: 'o_abc', + update: async (fields) => { + updated = fields; + }, + }); + }, + }, + }); + + await http + .post('/api/wechat/bind') + .send({ userId: 2, appid: 'wx123', openid: 'o_abc', sessionKey: 'sk-1' }) + .expect(201); + + assert(updated.userId === 2, '应支持把授权记录换绑到另一个用户'); + assert(updated.sessionKey === 'sk-1'); + }); + + it('POST /api/wechat/bind 缺少必填参数返回 422', async () => { + await http.post('/api/wechat/bind').send({ appid: 'wx123' }).expect(422); + }); + + it('GET /api/wechat/:appid/:openid 返回授权与关联用户', async () => { + mock(app, 'model', { + User: { name: 'User' }, + WechatOauth: { + async findOne() { + return instance({ + id: 9, + appid: 'wx123', + openid: 'o_abc', + user: { id: 1, nickname: '张三', deleted_at: null }, + }); + }, + }, + }); + + const res = await http.get('/api/wechat/wx123/o_abc').expect(200); + assert(res.body.data.user.nickname === '张三'); + assert(res.body.data.user.deleted_at === undefined, '不应透出软删除字段'); + }); + + it('GET /api/wechat/:appid/:openid 不存在返回 404', async () => { + mock(app, 'model', { + User: {}, + WechatOauth: { + async findOne() { + return null; + }, + }, + }); + + await http.get('/api/wechat/wx123/o_none').expect(404); + }); + + it('GET /api/users/:id/wechats 返回该用户的授权列表', async () => { + mock(app, 'model', { + WechatOauth: { + async findAll(options) { + assert(options.where.userId === 1); + return [ instance({ id: 9, appid: 'wx123', openid: 'o_abc' }) ]; + }, + }, + }); + + const res = await http.get('/api/users/1/wechats').expect(200); + assert(res.body.data.total === 1); + }); + + it('PUT /api/wechat/:id/tokens 更新令牌', async () => { + mock(app, 'model', { + WechatOauth: { + async findByPk(id) { + assert(id === 9); + return instance({ + id: 9, + update: async fields => { + assert(fields.accessToken === 'at-1'); + assert(fields.tokenExpiresAt instanceof Date); + }, + }); + }, + }, + }); + + await http + .put('/api/wechat/9/tokens') + .send({ accessToken: 'at-1', expiresIn: 7200 }) + .expect(200); + }); + + it('PUT /api/wechat/:id/tokens 记录不存在返回 404', async () => { + mock(app, 'model', { + WechatOauth: { + async findByPk() { + return null; + }, + }, + }); + + await http.put('/api/wechat/9/tokens').send({ accessToken: 'at-1' }).expect(404); + }); + + it('DELETE /api/wechat/:id 解绑成功 / 不存在返回 404', async () => { + mock(app, 'model', { + WechatOauth: { + async destroy() { + return 1; + }, + }, + }); + await http.delete('/api/wechat/9').expect(200); + + mock(app, 'model', { + WechatOauth: { + async destroy() { + return 0; + }, + }, + }); + await http.delete('/api/wechat/9').expect(404); + }); +}); diff --git a/backend/test/utils/fake-redis.js b/backend/test/utils/fake-redis.js new file mode 100644 index 0000000..790e749 --- /dev/null +++ b/backend/test/utils/fake-redis.js @@ -0,0 +1,157 @@ +'use strict'; + +/** + * 内存版 Redis,单测用(不做 key 前缀处理,直接按完整 key 存取) + * 用法:const { store, client } = createFakeRedis(); mock(app, 'redis', client); + * + * 支持本项目用到的命令:get / set(含 EX、NX)/ setex / del / exists / ttl / incr / expire / keys + * 会按 EX/setex 的秒数做真实的过期判断(否则「重发节流」这类用例没法测)。 + * + * 也支持长轮询用到的发布订阅:duplicate() / subscribe() / publish() / on('message') / disconnect() + * —— duplicate 出来的 client 共享同一份 key 空间与消息总线,跟真实 Redis 行为一致; + * 每个 client 只订阅一个频道(本项目就这个用法)。 + */ +module.exports = function createFakeRedis() { + const store = new Map(); + const expires = new Map(); + /** 频道 → 订阅者集合(每个订阅者 = { client, emit } ) */ + const channels = new Map(); + + /** 是否还存在(顺手清理已过期的 key) */ + function alive(key) { + if (!store.has(key)) return false; + const at = expires.get(key); + if (at && at <= Date.now()) { + store.delete(key); + expires.delete(key); + return false; + } + return true; + } + + const noop = () => null; + + /** 建过的所有 client(用来观察“还有几个长轮询在等”) */ + const clients = []; + + function createClient() { + const listeners = new Map(); // 事件名 → [fn] + const state = { channel: null, disconnected: false }; + + const emit = (event, ...args) => { + for (const fn of listeners.get(event) || []) fn(...args); + }; + + const client = { + async get(key) { + return alive(key) ? store.get(key) : null; + }, + async set(key, value, ...args) { + const options = args.map(item => String(item).toUpperCase()); + if (options.includes('NX') && alive(key)) return null; // NX 且已存在 → 失败 + + const exIndex = options.indexOf('EX'); + const ttl = exIndex >= 0 ? Number(args[exIndex + 1]) : NaN; + + store.set(key, String(value)); + if (Number.isFinite(ttl)) expires.set(key, Date.now() + ttl * 1000); + else expires.delete(key); + return 'OK'; + }, + async setex(key, ttl, value) { + store.set(key, String(value)); + expires.set(key, Date.now() + Number(ttl) * 1000); + return 'OK'; + }, + async del(key) { + expires.delete(key); + return store.delete(key) ? 1 : 0; + }, + async exists(key) { + return alive(key) ? 1 : 0; + }, + async ttl(key) { + if (!alive(key)) return -2; + const at = expires.get(key); + return at ? Math.max(Math.round((at - Date.now()) / 1000), 0) : -1; + }, + async incr(key) { + const next = Number(alive(key) ? store.get(key) : 0) + 1; + store.set(key, String(next)); + return next; + }, + async expire(key, ttl) { + if (!alive(key)) return 0; + expires.set(key, Date.now() + Number(ttl) * 1000); + return 1; + }, + async ping() { + return 'PONG'; + }, + async keys() { + return [ ...store.keys() ].filter(alive); + }, + + // ---------- 发布订阅(长轮询用) ---------- + duplicate() { + return createClient(); + }, + async subscribe(channel) { + state.channel = String(channel); + if (!channels.has(state.channel)) channels.set(state.channel, new Set()); + channels.get(state.channel).add(deliver); + return 1; + }, + async unsubscribe(channel) { + const set = channels.get(String(channel || state.channel)); + if (set) set.delete(deliver); + return 0; + }, + async publish(channel, message) { + const set = channels.get(String(channel)); + if (!set) return 0; + for (const fn of [ ...set ]) fn(String(message)); + return set.size; + }, + disconnect() { + state.disconnected = true; + for (const set of channels.values()) set.delete(deliver); + return client; + }, + quit() { + return client.disconnect(); + }, + // ---------- 给测试观察用 ---------- + subscribedChannel() { return state.channel; }, + isDisconnected() { return state.disconnected; }, + + on(event, fn) { + if (!listeners.has(event)) listeners.set(event, []); + listeners.get(event).push(fn); + return client; + }, + once(event, fn) { + return client.on(event, fn); + }, + removeAllListeners() { + listeners.clear(); + return client; + }, + }; + + /** 收到本 client 订阅频道上的消息 → 冒成 'message' 事件 */ + function deliver(message) { + emit('message', state.channel, message); + } + + clients.push(client); + return client; + } + + return { + store, + client: createClient(), + /** 还挂着的订阅连接数(长轮询断开后应该回到 0) */ + activeSubscribers: () => clients.filter(item => item.subscribedChannel() && !item.isDisconnected()).length, + }; +}; diff --git a/backend/test/utils/internal.js b/backend/test/utils/internal.js new file mode 100644 index 0000000..4fe24bf --- /dev/null +++ b/backend/test/utils/internal.js @@ -0,0 +1,15 @@ +'use strict'; + +/** + * 内部(运维)接口的鉴权头 —— 与 config/config.unittest.js 里的 token 对应 + * + * 用法: + * ```js + * const { HEADER: INTERNAL } = require('../../utils/internal'); + * const res = await app.httpRequest().get('/api/users').set(INTERNAL); + * ``` + * 公开接口多带这个 header 也没有副作用(只有内部路由会看它)。 + */ +const HEADER = { 'x-internal-token': 'test-internal-token' }; + +module.exports = { HEADER }; diff --git a/extension/README.md b/extension/README.md new file mode 100644 index 0000000..1447afd --- /dev/null +++ b/extension/README.md @@ -0,0 +1,162 @@ +# 云仓视频溯源 · 单号注入扩展 + +Chrome / Edge 扩展(**Manifest V3 + 原生 JS,零构建**)。 + +它注入到**第三方 WMS / 后台页面**里,按规则把「运单号」这类字段就地**二次加工**成可点击元素; +点击后打开溯源页面(当前先用 `https://www.baidu.com/?keyword={code}` 占位),把编号作为关键词带过去。 + +> 首个取样站点:`https://wms.wms.gztbyc.com/order/orderManagement` +> 运单号长这样: +> ```html +> title="点击复制并查看快递单号二维码">321408064481776 +> ``` +> 点击它 → 小窗打开 `https://www.baidu.com/?keyword=321408064481776` + +--- + +## 1. 安装 + +1. 打开 `chrome://extensions`(Edge 是 `edge://extensions`)。 +2. 右上角打开 **开发者模式**。 +3. 点 **加载已解压的扩展程序**,选择本目录 `extension/`。 +4. 刷新一下已经打开的 WMS 页面(扩展只对**安装之后**加载的页面生效)。 + +图标缺失时重新生成:`powershell -ExecutionPolicy Bypass -File tools\make-icons.ps1` + +## 2. 目录结构 + +``` +extension/ +├── manifest.json # MV3 声明;权限只有 "storage" +├── icons/ # 16/32/48/128,由 tools/make-icons.ps1 生成 +├── src/ +│ ├── lib/rules.js # ★ 规则引擎(配置归一化 / 正则编译 / DOM 加工 / 地址拼接) +│ ├── content.js # 注入脚本:扫描 + 加工 + 点击拦截 + MutationObserver 补标 +│ ├── content.css # 注入样式(全部 .pst- 前缀 + !important) +│ ├── background.js # service worker:只负责把算好的地址打开(小窗 / 新标签页) +│ ├── popup.html/.css/.js # 工具栏弹窗:开关、本页命中清单、重新扫描 +│ └── options.html/.css/.js # ★ 规则配置页:基本设置 / 规则编辑 / 试跑 / 导入导出 +├── test/wms-mock.html # 自测页:按真实结构复刻的表格 +└── tools/make-icons.ps1 # 生成图标(纯 ASCII,见文件头说明) +``` + +**没有构建步骤**:`rules.js` 挂在 `globalThis.PSTRules` 上,content script / popup / options 各自 +用 ` + + + diff --git a/extension/src/options.js b/extension/src/options.js new file mode 100644 index 0000000..2532b8d --- /dev/null +++ b/extension/src/options.js @@ -0,0 +1,383 @@ +'use strict'; +/** + * 云仓视频溯源 · 规则配置页 + * + * 说明: + * - 页面上所有读写都围绕「配置对象」,最终由 PSTRules.normalizeConfig 兜底(缺字段/非法值都不会写坏)。 + * - 「试跑」用的是**当前表单里还没保存**的规则,方便边调正则边看结果。 + * - 试跑里渲染 HTML 一律走 PSTRules.escapeHtml,不把外来 HTML 直接 innerHTML 进本页(杜绝 onerror 之类)。 + */ +(function () { + const R = globalThis.PSTRules; + const $ = id => document.getElementById(id); + + /** 取样自 https://wms.wms.gztbyc.com/order/orderManagement 的一整行(已精简掉无关列) */ + const SAMPLE_HTML = [ + '', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + '
JY2026101619599321408064481776', + ' E20261016000696930529169563286869已打包2026-10-16 13:26:22
', + ].join('\n'); + + let cfg = R.defaultConfig(); + + boot(); + + async function boot() { + cfg = await R.loadConfig(); + fillBase(cfg); + renderRules(cfg.rules); + + $('testHost').value = 'wms.wms.gztbyc.com'; + $('testInput').value = SAMPLE_HTML; + + bind(); + updateUrlPreview(); + runTest(); + } + + /* ============================== 基本设置 ============================== */ + + function fillBase(c) { + $('enabled').value = String(c.enabled); + $('openMode').value = c.openMode; + $('markStyle').value = c.markStyle; + $('showIcon').value = String(c.showIcon); + $('hosts').value = (c.hosts || []).join('\n'); + $('urlTemplate').value = c.urlTemplate; + $('scanDelay').value = c.scanDelay; + $('maxMarks').value = c.maxMarks; + $('maxNodes').value = c.maxNodes; + } + + function readBase() { + return { + enabled: $('enabled').value === 'true', + openMode: $('openMode').value, + markStyle: $('markStyle').value, + showIcon: $('showIcon').value === 'true', + hosts: $('hosts').value, + urlTemplate: $('urlTemplate').value, + scanDelay: $('scanDelay').value, + maxMarks: $('maxMarks').value, + maxNodes: $('maxNodes').value, + }; + } + + /** 表单 → 合法配置对象(同时用于保存和试跑) */ + function readForm() { + return R.normalizeConfig(Object.assign(readBase(), { rules: readRules() })); + } + + /* ================================ 规则 ================================ */ + + const field = (card, name) => card.querySelector('[data-field="' + name + '"]'); + + function renderRules(rules) { + const box = $('rules'); + box.textContent = ''; + for (const rule of rules) box.appendChild(ruleCard(rule)); + } + + function ruleCard(rule) { + const card = $('rule-tpl').content.firstElementChild.cloneNode(true); + card.dataset.id = rule.id; + field(card, 'enabled').checked = !!rule.enabled; + field(card, 'name').value = rule.name; + field(card, 'match').value = rule.match; + field(card, 'style').value = rule.style || ''; + field(card, 'pattern').value = rule.pattern; + field(card, 'flags').value = rule.flags; + field(card, 'exclude').value = rule.exclude; + field(card, 'selector').value = rule.selector; + field(card, 'attr').value = rule.attr; + field(card, 'hostPatterns').value = (rule.hostPatterns || []).join(' '); + field(card, 'urlTemplate').value = rule.urlTemplate; + card.querySelector('[data-id]').textContent = rule.id; + updateWhen(card); + updateOff(card); + return card; + } + + function readRules() { + return Array.prototype.slice.call($('rules').querySelectorAll('.rule')).map(card => ({ + id: card.dataset.id, + enabled: field(card, 'enabled').checked, + name: field(card, 'name').value.trim(), + match: field(card, 'match').value, + style: field(card, 'style').value, + pattern: field(card, 'pattern').value, + flags: field(card, 'flags').value, + exclude: field(card, 'exclude').value, + selector: field(card, 'selector').value, + attr: field(card, 'attr').value.trim(), + hostPatterns: field(card, 'hostPatterns').value, + urlTemplate: field(card, 'urlTemplate').value.trim(), + })); + } + + function updateWhen(card) { + const mode = field(card, 'match').value; + for (const el of card.querySelectorAll('[data-when]')) { + el.style.display = el.getAttribute('data-when') === mode ? '' : 'none'; + } + } + + function updateOff(card) { + card.classList.toggle('is-off', !field(card, 'enabled').checked); + } + + function newRule() { + // 借 normalizeRule 生成一个不重复的 id,顺便把字段补齐 + return R.normalizeRule({ + name: '新规则', + enabled: true, + match: 'text', + pattern: '\\b[A-Z]{2}\\d{10,16}\\b', + flags: 'gi', + hostPatterns: ['*'], + }); + } + + function onRulesClick(e) { + const btn = e.target.closest('button[data-act]'); + if (!btn) return; + const card = btn.closest('.rule'); + const rules = $('rules'); + const act = btn.dataset.act; + + if (act === 'del') { + if (!confirm('删除规则「' + field(card, 'name').value + '」?(记得点保存才会生效)')) return; + card.remove(); + } else if (act === 'up' && card.previousElementSibling) { + rules.insertBefore(card, card.previousElementSibling); + } else if (act === 'down' && card.nextElementSibling) { + rules.insertBefore(card.nextElementSibling, card); + } else if (act === 'dup') { + const src = readRules().find(r => r.id === card.dataset.id); + if (!src) return; + const copy = R.normalizeRule(Object.assign({}, src, { + id: newRule().id, + name: (src.name || '规则') + ' 副本', + })); + rules.insertBefore(ruleCard(copy), card.nextElementSibling); + } + } + + /* ================================ 试跑 ================================ */ + + function runTest() { + const form = readForm(); + const compiled = R.compileRules(form.rules); + const simHost = $('testHost').value.trim(); + const mode = $('testMode').value; + const raw = $('testInput').value; + const box = $('testResult'); + box.textContent = ''; + + if (!raw.trim()) { + box.appendChild(el('p', 'muted', '先粘一段 HTML / 文本再试跑。')); + return; + } + + let items = []; + let marks = []; + let truncated = false; + + if (mode === 'html') { + const doc = new DOMParser().parseFromString(raw, 'text/html'); + const res = R.applyMarks(doc.body, compiled, { + markClass: 'pst-trace-mark', + maxNodes: 3000, + maxMarks: 200, + defaultStyle: form.markStyle, + showIcon: form.showIcon, + urlTemplate: form.urlTemplate, + hostname: simHost, + host: simHost, + }); + items = res.items; + marks = res.marks; + truncated = res.truncated; + } else { + for (const line of raw.split(/\r?\n/)) { + for (const m of R.matchText(line, compiled, 20)) { + items.push({ + ruleId: m.rule.id, + ruleName: m.rule.name, + code: m.code, + url: R.buildUrl(m.rule.urlTemplate || form.urlTemplate, m.code, simHost), + }); + } + } + } + + // ---- 概览 ---- + const head = el('p', 'muted'); + head.innerHTML = '启用规则 ' + compiled.rules.length + ' 条' + + ' · 命中 ' + items.length + ' 条' + + (truncated ? ' · 已达上限,可能有遗漏' : '') + + ' · 模拟站点 ' + R.escapeHtml(simHost || '(空)') + ''; + box.appendChild(head); + + for (const err of compiled.errors) { + box.appendChild(el('p', 'bad', '规则「' + err.name + '」无效:' + err.message)); + } + + // ---- 命中表 ---- + if (items.length) { + const table = document.createElement('table'); + table.innerHTML = '规则提取的编号目标地址'; + const tbody = document.createElement('tbody'); + for (const it of items) { + const tr = document.createElement('tr'); + tr.innerHTML = '' + R.escapeHtml(it.ruleName || it.ruleId) + '' + + '' + R.escapeHtml(it.code) + '' + + '' + R.escapeHtml(it.url) + ''; + tbody.appendChild(tr); + } + table.appendChild(tbody); + box.appendChild(table); + } else { + // 0 命中时把「为什么没命中」说清楚:多半是生效站点把规则挡住了 + const enabled = form.rules.filter(r => r.enabled); + if (enabled.length) { + const box2 = el('div', 'snippet'); + box2.textContent = enabled.map(r => '· ' + r.name + ' 生效站点:' + r.hostPatterns.join(' / ') + + (r.match === 'selector' ? ' 选择器:' + r.selector : ' 正则:' + r.pattern)).join('\n') + + '\n(模拟站点不在「生效站点」里、或选择器/正则没命中,都会是 0 条)'; + box.appendChild(box2); + } + } + + // ---- 二次加工后的源码片段(转义显示,不执行)---- + if (marks.length) { + const snippet = el('div', 'snippet'); + snippet.textContent = marks.slice(0, 3) + .map(m => trim(m.el.outerHTML, 240)) + .join('\n\n'); + box.appendChild(el('p', 'muted', '二次加工后的 HTML(最多 3 段):')); + box.appendChild(snippet); + } + } + + /* ============================ 导入导出/重置 ============================ */ + + async function reset() { + if (!confirm('恢复为内置默认规则?当前配置会被覆盖。')) return; + await save(R.defaultConfig()); + } + + /* ================================ 保存 ================================ */ + + async function save(value) { + const res = await R.saveConfig(value || readForm()); + if (!res.ok) { + toast('保存失败:' + (res.message || ''), true); + return; + } + cfg = await R.loadConfig(); + fillBase(cfg); + renderRules(cfg.rules); + updateUrlPreview(); + $('savedAt').textContent = '最后保存 ' + new Date().toLocaleTimeString(); + toast(res.warning ? '已保存(' + res.warning + ')' : '已保存 —— 已打开的页面会自动重新扫描'); + } + + function updateUrlPreview() { + const host = $('testHost').value.trim() || 'wms.wms.gztbyc.com'; + $('urlPreview').textContent = '预览:' + R.buildUrl($('urlTemplate').value, '321408064481776', host); + } + + /* ================================ 绑定 ================================ */ + + function bind() { + $('save').addEventListener('click', () => save()); + $('add-rule').addEventListener('click', () => { + $('rules').appendChild(ruleCard(newRule())); + }); + + const rulesBox = $('rules'); + rulesBox.addEventListener('click', onRulesClick); + rulesBox.addEventListener('change', e => { + const card = e.target.closest('.rule'); + if (!card) return; + const name = e.target.getAttribute('data-field'); + if (name === 'match') updateWhen(card); + if (name === 'enabled') updateOff(card); + // 规则改了就顺手重跑一遍试跑,$('testInput') 里没东西时不会报错 + if (name) runTest(); + }); + + $('run-test').addEventListener('click', runTest); + $('fill-sample').addEventListener('click', () => { + $('testMode').value = 'html'; + $('testInput').value = SAMPLE_HTML; + runTest(); + }); + + $('urlTemplate').addEventListener('input', updateUrlPreview); + $('testHost').addEventListener('input', updateUrlPreview); + $('testInput').addEventListener('input', debounce(runTest, 350)); + + $('export').addEventListener('click', () => { + $('json').value = JSON.stringify(readForm(), null, 2); + toast('已导出到下面的文本框,复制走即可'); + }); + $('import').addEventListener('click', async () => { + let parsed; + try { + parsed = JSON.parse($('json').value); + } catch (e) { + toast('JSON 解析失败:' + e.message, true); + return; + } + await save(parsed); + }); + $('reset').addEventListener('click', reset); + + window.addEventListener('keydown', e => { + if ((e.ctrlKey || e.metaKey) && e.key === 's') { + e.preventDefault(); + save(); + } + }); + } + + /* ================================ 小工具 ================================ */ + + function el(tag, cls, text) { + const node = document.createElement(tag); + if (cls) node.className = cls; + if (text != null) node.textContent = text; + return node; + } + + let toastTimer = null; + function toast(message, bad) { + const box = $('toast'); + box.textContent = message; + box.className = 'toast' + (bad ? ' bad' : ''); + box.hidden = false; + clearTimeout(toastTimer); + toastTimer = setTimeout(() => { box.hidden = true; }, bad ? 6000 : 2600); + } + + function trim(s, max) { + const t = String(s || ''); + return t.length > max ? t.slice(0, max) + ' …(' + t.length + ' 字符)' : t; + } + + function debounce(fn, ms) { + let t = null; + return function () { + clearTimeout(t); + t = setTimeout(fn, ms); + }; + } +})(); diff --git a/extension/src/popup.css b/extension/src/popup.css new file mode 100644 index 0000000..58eae2a --- /dev/null +++ b/extension/src/popup.css @@ -0,0 +1,131 @@ +:root { + --bg: #f6f8fa; + --fg: #1f2328; + --muted: #6b7280; + --border: #d9dee5; + --brand: #0b7d7c; + --brand-2: #0ea5a4; +} + +* { box-sizing: border-box; } + +body { + width: 336px; + margin: 0; + padding: 10px 10px 12px; + background: var(--bg); + color: var(--fg); + font: 13px/1.5 "Microsoft YaHei", "Segoe UI", system-ui, sans-serif; +} + +header { + display: flex; + align-items: center; + gap: 8px; + padding: 2px 2px 10px; +} +.logo { width: 24px; height: 24px; flex: none; } +.title { flex: 1 1 auto; min-width: 0; } +h1 { margin: 0; font-size: 13px; font-weight: 600; } +.muted { color: var(--muted); } +#host { + margin: 0; + font-size: 11px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.card { + background: #fff; + border: 1px solid var(--border); + border-radius: 8px; + padding: 8px 10px; + margin-bottom: 8px; +} +.card .row { display: flex; align-items: center; gap: 6px; font-size: 12px; } +.card .row.head { justify-content: space-between; color: var(--muted); } +.card .row.head b { color: var(--fg); font-size: 13px; } +.card .row + .row { margin-top: 4px; } + +.badge { + display: inline-block; + padding: 0 6px; + border-radius: 999px; + font-size: 11px; + line-height: 18px; +} +.badge.ok { background: #e6f7f6; color: var(--brand); } +.badge.warn { background: #fff4e5; color: #b45309; } +.badge.off { background: #eef0f3; color: var(--muted); } + +.list { + list-style: none; + margin: 6px 0 0; + padding: 0; + max-height: 190px; + overflow-y: auto; +} +.list li { + display: flex; + align-items: center; + gap: 6px; + padding: 4px 6px; + border-radius: 5px; + cursor: pointer; +} +.list li:hover { background: #eef6f6; } +.list li .code { + font-family: Consolas, "Courier New", monospace; + font-size: 12px; + flex: 1 1 auto; + min-width: 0; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} +.list li .rule { color: var(--muted); font-size: 10px; flex: none; } + +.empty { margin: 6px 0 0; font-size: 12px; } + +.actions { display: flex; gap: 8px; } +button { + flex: 1 1 0; + padding: 7px 8px; + border: 1px solid var(--border); + border-radius: 6px; + background: #fff; + color: var(--fg); + font-size: 12px; + cursor: pointer; +} +button:hover { border-color: var(--brand-2); color: var(--brand); } +button.primary { + background: var(--brand); + border-color: var(--brand); + color: #fff; +} +button.primary:hover { background: var(--brand-2); border-color: var(--brand-2); color: #fff; } + +/* 开关 */ +.sw { position: relative; display: inline-block; width: 36px; height: 20px; flex: none; } +.sw input { position: absolute; opacity: 0; width: 0; height: 0; } +.sw span { + position: absolute; + inset: 0; + background: #cbd5e1; + border-radius: 999px; + transition: background .15s ease; +} +.sw span::after { + content: ""; + position: absolute; + top: 2px; left: 2px; + width: 16px; height: 16px; + background: #fff; + border-radius: 50%; + transition: transform .15s ease; +} +.sw input:checked + span { background: var(--brand-2); } +.sw input:checked + span::after { transform: translateX(16px); } +.sw input:focus-visible + span { box-shadow: 0 0 0 2px rgba(14,165,164,.4); } diff --git a/extension/src/popup.html b/extension/src/popup.html new file mode 100644 index 0000000..158ec66 --- /dev/null +++ b/extension/src/popup.html @@ -0,0 +1,42 @@ + + + + + 云仓视频溯源 + + + +
+ +
+

云仓视频溯源

+

—

+
+ +
+ +
+
正在读取当前页面…
+
+ +
+
+ 本页命中 + 0 +
+
    +

    还没有命中项。

    +
    + +
    + + +
    + + + + + diff --git a/extension/src/popup.js b/extension/src/popup.js new file mode 100644 index 0000000..1677db1 --- /dev/null +++ b/extension/src/popup.js @@ -0,0 +1,155 @@ +'use strict'; +/** + * 云仓视频溯源 · 工具栏弹窗 + * + * 只做展示 + 少量开关,真正的注入逻辑在 content.js 里。 + * 和 content script 的通信都走 chrome.tabs.sendMessage(tabId, msg, { frameId: 0 }) —— + * 指定 frameId 很重要:页面里可能有多个 iframe 都注入了脚本,不定帧会拿到不确定的那个回复。 + */ +(function () { + const R = globalThis.PSTRules; + const $ = id => document.getElementById(id); + + let tab = null; + let cfg = R.defaultConfig(); + let status = null; + + init(); + + async function init() { + try { + cfg = await R.loadConfig(); + } catch (_) { + cfg = R.defaultConfig(); + } + $('enabled').checked = !!cfg.enabled; + + $('enabled').addEventListener('change', onToggle); + $('rescan').addEventListener('click', onRescan); + $('open-options').addEventListener('click', () => chrome.runtime.openOptionsPage()); + + try { + tab = await activeTab(); + if (!tab || !/^https?:/i.test(tab.url || '')) { + renderUnsupported(); + } else { + $('host').textContent = safeHost(tab.url); + status = await send(tab.id, { type: 'pst:status' }); + render(); + } + } catch (e) { + // 兜底:宁可显示一行错误,也不要弹窗一片空白 + $('state').innerHTML = '
    出错' + + '' + R.escapeHtml(String((e && e.message) || e)) + '
    '; + } + } + + /* ------------------------------------------------------------ 渲染 */ + + function render() { + const stateBox = $('state'); + + if (!status || !status.ok) { + stateBox.innerHTML = '
    未注入' + + '这个页面还没有脚本,刷新一下即可
    '; + } else if (!status.enabled) { + stateBox.innerHTML = '
    已关闭' + + '总开关处于关闭状态
    '; + } else if (!status.hostAllowed && !status.active) { + stateBox.innerHTML = '
    不在生效范围
    ' + + '
    生效站点:' + R.escapeHtml((status.hosts || []).join(' / ')) + '
    '; + } else { + stateBox.innerHTML = '
    注入中' + + '启用规则 ' + status.ruleCount + ' 条 · ' + + (status.openMode === 'window' ? '小窗打开' : '新标签页打开') + '
    ' + + (status.ruleErrors && status.ruleErrors.length + ? '
    ' + status.ruleErrors.length + ' 条规则无效
    ' + : ''); + } + + const items = (status && status.items) || []; + $('total').textContent = String(items.length) + (status && status.truncated ? '+' : ''); + $('empty').style.display = items.length ? 'none' : 'block'; + + const list = $('list'); + list.textContent = ''; + for (const it of items) { + const li = document.createElement('li'); + li.title = it.url || ''; + const code = document.createElement('span'); + code.className = 'code'; + code.textContent = it.code; + const rule = document.createElement('span'); + rule.className = 'rule'; + rule.textContent = it.ruleId || ''; + li.append(code, rule); + li.addEventListener('click', () => openUrl(it.url)); + list.appendChild(li); + } + } + + function renderUnsupported() { + $('host').textContent = '当前页面'; + $('state').innerHTML = '
    不支持' + + '本扩展只在 http / https 页面上工作
    '; + $('empty').style.display = 'none'; + } + + /* ------------------------------------------------------------ 交互 */ + + async function onToggle() { + const next = $('enabled').checked; + cfg.enabled = next; + const res = await R.saveConfig(cfg); + if (!res.ok) { + $('enabled').checked = !next; + $('state').innerHTML = '
    保存失败' + + '' + R.escapeHtml(res.message || '') + '
    '; + return; + } + cfg = await R.loadConfig(); + // content script 收到 storage 变更会自己重新扫描,这里刷一下展示 + status = tab ? await send(tab.id, { type: 'pst:status' }) : null; + render(); + } + + async function onRescan() { + if (!tab) return; + status = await send(tab.id, { type: 'pst:rescan' }); + render(); + } + + function openUrl(url) { + if (!url) return; + chrome.runtime.sendMessage({ type: 'pst:open', url, mode: cfg.openMode }, () => { + void chrome.runtime.lastError; + }); + } + + /* ------------------------------------------------------------ 工具 */ + + function activeTab() { + return new Promise(resolve => { + chrome.tabs.query({ active: true, currentWindow: true }, tabs => { + resolve((tabs && tabs[0]) || null); + }); + }); + } + + function send(tabId, msg) { + return new Promise(resolve => { + try { + chrome.tabs.sendMessage(tabId, msg, { frameId: 0 }, res => { + const err = chrome.runtime.lastError; + resolve(err ? { ok: false, message: err.message } : res); + }); + } catch (e) { + resolve({ ok: false, message: String((e && e.message) || e) }); + } + }); + } + + function safeHost(url) { + try { return new URL(url).host; } catch (_) { return url || ''; } + } +})(); diff --git a/extension/test/wms-mock.html b/extension/test/wms-mock.html new file mode 100644 index 0000000..a182840 --- /dev/null +++ b/extension/test/wms-mock.html @@ -0,0 +1,77 @@ + + + + + WMS 取样页 · 云仓视频溯源注入自测 + + + +

    WMS 取样页(自测用)

    +

    + 结构与 https://wms.wms.gztbyc.com/order/orderManagement 的一行一致:只有「运单号」那个 span 带 + title="点击复制并查看快递单号二维码",同行的发货单号 / 波次号 / 平台交易单号都不该被标记。
    + 加载扩展后打开本页:运单号应出现青色虚线下划线 + ▶ 角标,点击会打开小窗。 +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    发货单号运单号(快递单号)波次号平台交易单号状态下单时间
    JY2026101619599
    321408064481776
    E2026101600069
    6930529169563286869
    已打包2026-10-16 13:26:22
    JY2026101615872
    321408064481576
    E2026101600069
    6930516355859054381
    已打包2026-10-16 13:46:54
    JY2026101416270
    321407672814174
    B2026101600532
    6918483774881410405
    已打包2026-10-13 08:36:42
    + +

    + 预期:表格里 3 个运单号 被标记,其余 9 个蓝色文本不受影响。 +

    + + diff --git a/extension/tools/make-icons.ps1 b/extension/tools/make-icons.ps1 new file mode 100644 index 0000000..7d07824 --- /dev/null +++ b/extension/tools/make-icons.ps1 @@ -0,0 +1,70 @@ +# Generate extension icons (16 / 32 / 48 / 128). Zero dependency: System.Drawing only. +# +# Usage (PowerShell 5.1): +# powershell -ExecutionPolicy Bypass -File tools\make-icons.ps1 +# +# IMPORTANT - keep this file pure ASCII. +# PowerShell 5.1 on a zh-CN machine reads .ps1 files WITHOUT a BOM as GBK, so any UTF-8 +# Chinese in here becomes mojibake; and mojibake inside a format string such as +# ("done: {0}" -f $x) can even break parsing: "Input string was not in a correct format". +# +# Artwork: rounded gradient tile (deep blue -> teal) + white barcode bars. + +Add-Type -AssemblyName System.Drawing + +$root = Split-Path -Parent $PSScriptRoot # extension/ +$outDir = Join-Path $root 'icons' +New-Item -ItemType Directory -Force -Path $outDir | Out-Null + +function New-Icon([int]$size) { + $bmp = New-Object System.Drawing.Bitmap($size, $size, [System.Drawing.Imaging.PixelFormat]::Format32bppArgb) + $g = [System.Drawing.Graphics]::FromImage($bmp) + $g.SmoothingMode = [System.Drawing.Drawing2D.SmoothingMode]::AntiAlias + $g.Clear([System.Drawing.Color]::Transparent) + + # ---- rounded rectangle background ---- + $r = [Math]::Max(2, [int]($size * 0.22)) + $d = $r * 2 + $rect = New-Object System.Drawing.Rectangle(0, 0, $size, $size) + $path = New-Object System.Drawing.Drawing2D.GraphicsPath + $path.AddArc($rect.X, $rect.Y, $d, $d, 180, 90) + $path.AddArc($rect.Right - $d, $rect.Y, $d, $d, 270, 90) + $path.AddArc($rect.Right - $d, $rect.Bottom - $d, $d, $d, 0, 90) + $path.AddArc($rect.X, $rect.Bottom - $d, $d, $d, 90, 90) + $path.CloseAllFigures() + + $c1 = [System.Drawing.Color]::FromArgb(255, 12, 74, 110) + $c2 = [System.Drawing.Color]::FromArgb(255, 14, 165, 164) + $brush = [System.Drawing.Drawing2D.LinearGradientBrush]::new($rect, $c1, $c2, [single]45) + $g.FillPath($brush, $path) + + # ---- white barcode bars, alternating heights ---- + $white = [System.Drawing.SolidBrush]::new([System.Drawing.Color]::FromArgb(255, 255, 255, 255)) + $barW = [Math]::Max(1, [int]($size * 0.075)) + $gap = [Math]::Max(1, [int]($size * 0.055)) + $x = [int]($size * 0.20) + $top = [int]($size * 0.28) + $bot = [int]($size * 0.72) + $limit = $size * 0.82 + $ratios = @(0.55, 1.0, 0.72, 1.0, 0.6, 0.88, 1.0, 0.66) + foreach ($ratio in $ratios) { + if ($x + $barW -gt $limit) { break } + $h = [int](($bot - $top) * $ratio) + $g.FillRectangle($white, $x, ($bot - $h), $barW, $h) + $x += $barW + $gap + } + + $g.Dispose() + $brush.Dispose() + $white.Dispose() + $path.Dispose() + + $file = Join-Path $outDir ("icon{0}.png" -f $size) + $bmp.Save($file, [System.Drawing.Imaging.ImageFormat]::Png) + $bmp.Dispose() + Write-Host (" {0,-16} {1}x{1}" -f (Split-Path -Leaf $file), $size) +} + +Write-Host 'Building icons ->' +foreach ($s in 16, 32, 48, 128) { New-Icon $s } +Write-Host ('Done. Output: {0}' -f $outDir) diff --git a/frontend/index.html b/frontend/index.html new file mode 100644 index 0000000..5a405f9 --- /dev/null +++ b/frontend/index.html @@ -0,0 +1,12 @@ + + + + + + 云仓视频溯源系统 + + +
    + + + diff --git a/frontend/package-lock.json b/frontend/package-lock.json new file mode 100644 index 0000000..9c6f830 --- /dev/null +++ b/frontend/package-lock.json @@ -0,0 +1,1639 @@ +{ + "name": "pack-service-frontend", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "pack-service-frontend", + "version": "1.0.0", + "dependencies": { + "vue": "^3.5.44", + "vue-router": "^5.4.0" + }, + "devDependencies": { + "@types/node": "^26.6.5", + "@vitejs/plugin-vue": "^6.0.10", + "typescript": "^5.9.3", + "vite": "^8.3.4", + "vue-tsc": "^3.3.13" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.29.7.tgz", + "integrity": "sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.7.tgz", + "integrity": "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.29.9", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.9.tgz", + "integrity": "sha512-CjXrNHTnvqBVqHgdBysY3vk2T8tpJHb5/RMeHJBTyVa9xgugCB0CJTx/3oO8RV2QRQP391RWpB7D6hLjm8V9uA==", + "license": "MIT", + "dependencies": { + "@babel/types": "^7.29.8" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/types": { + "version": "7.29.8", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.8.tgz", + "integrity": "sha512-Vj1jF3cPfxg7OAfoI7QnVKLoILlm2JF9pnVHrX8qx7AHMiYWT+NDAA7jChlNgRS4WTLc/fD1lXLmPixluj+3Gg==", + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.29.7", + "@babel/helper-validator-identifier": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "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.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "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.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz", + "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==", + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@oxc-project/types": { + "version": "0.154.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.154.0.tgz", + "integrity": "sha512-KYOUGQFlLWR+s4QMV2Q9ko38TZm7EdO87Qm7rvZLqk/webse/cDjtyxKhg/47l0byCbs/k46LT8qc4PKjAikzA==", + "devOptional": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/oxc-project" + } + }, + "node_modules/@rolldown/binding-android-arm-eabi": { + "version": "1.2.14", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm-eabi/-/binding-android-arm-eabi-1.2.14.tgz", + "integrity": "sha512-aWR+XKH9+rW7m5fWq/5360J3mHycrx/o6xZM2DQFdJnTMdyP7/WzxPjhtLbVWdKo2y612/4U1bWqb3HQhiF7vg==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-android-arm64": { + "version": "1.2.14", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.2.14.tgz", + "integrity": "sha512-QiVxHofl6A8lQU7WAtOUY4QMVZXohxwz7WJJoeh8NBEUyKfIkMRKhYyq8az/1RypNiIXzNTtiS6KwHz0erxYRQ==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-arm64": { + "version": "1.2.14", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.2.14.tgz", + "integrity": "sha512-lTQOzHuBIooh3jIr5XINQkjPGEuGy+Dsy0meXDr6Sjty0b99kYgGh4uBC/8mJX1T0kC8d6S0aPP1Y+bHkh6aBw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-x64": { + "version": "1.2.14", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.2.14.tgz", + "integrity": "sha512-hyMKEGatjmBYCs/Q4sbIcL/GqpFEqsX3wc+HYVQ/85A4rxc1o7rPm4DUI4GV4k/h0ITddwFSGpqQunI14GXjTA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-freebsd-x64": { + "version": "1.2.14", + "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.2.14.tgz", + "integrity": "sha512-u371GbXoVXrEgP20PwzoGNOdAOqAMhzo19JzzY+V4YmmnC+DTOoqdbMu+O+54emM59Mik/UdrtWgcuEDKWRPKA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm-gnueabihf": { + "version": "1.2.14", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.2.14.tgz", + "integrity": "sha512-BqwKsdZQf6EqVWr8fv2MrDYzAvOZ7+NYFSJESRGs87fkseEhs0TU9TXgRJTkZoRRkxTizyEg1LKUXfU3/78uqg==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-gnu": { + "version": "1.2.14", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.2.14.tgz", + "integrity": "sha512-SD9kY8M009x/7s57Z1dgUVlP5+uYBgKQK0Tkr1WIWngrtUJmRCW1RJFMY7QDla2khXhmg2i5Io7MUjcmZNZ/KQ==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-musl": { + "version": "1.2.14", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.2.14.tgz", + "integrity": "sha512-BJ2CL19M6uuWesMgnqJzgxoI+N+eV7b0A9O9vLV42y+gitC41fNa8KElau1tHVzuLWX5GzEuxMPhAO0tQXQMkg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-ppc64-gnu": { + "version": "1.2.14", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.2.14.tgz", + "integrity": "sha512-4+Kl8daPV8NDHaD7mfCcc1pRM+Qg7ab8DyMm5FG5WoZgv4h2i3KFN1CybYBNbQqmuYm7ftJLvmMI1eHYJ22S/Q==", + "cpu": [ + "ppc64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-s390x-gnu": { + "version": "1.2.14", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.2.14.tgz", + "integrity": "sha512-V/h8ePq1fKDrmtFMz6xcCN3DKvuvMRrwwD1q0PkBeeo4DpK64biaKvqWGVxqCeYKqeRk7gE7/iKPxLCn08O97A==", + "cpu": [ + "s390x" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-gnu": { + "version": "1.2.14", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.2.14.tgz", + "integrity": "sha512-WxalXzgrLVpKC93xfpaJ3gCXUWzeCr+FRCbDVD2mUAy4L6Vo3lNVz0epUEUpxPWJkLNYUwM4OSIikv36OJ9mLg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-musl": { + "version": "1.2.14", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.2.14.tgz", + "integrity": "sha512-3G3tnAmTpdk9jO3GQtyHXqeFD2SlecfTws/Y3M2mmj9nMBwwuLT4kur8sZKeu7ENUHSpVO3cIsm5A52LEWWwlg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-openharmony-arm64": { + "version": "1.2.14", + "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.2.14.tgz", + "integrity": "sha512-qyr5XiNGxm2ytx17vvtcJ9nXn6v1gENETi503bJx3OGwZ1tSonj7BosxbMa/xeAfSl5iS9X6KjEWYXLu6v1L7Q==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-win32-arm64-msvc": { + "version": "1.2.14", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.2.14.tgz", + "integrity": "sha512-oA4o5o0S2yB199YyYXDzKUv1Z56Rc+mgOjwm7Z/vJ9Z8igiDPYvoOuDyo6g7AK/ZaF09nPhDKVnGBcYHO11GXA==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-win32-x64-msvc": { + "version": "1.2.14", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.2.14.tgz", + "integrity": "sha512-9mE94bf2GZUaR/fUSXCMpBoWkctu421Mi0ORpm4zqfbkjKep7RxzPFa5etcGs5h+2KApoWBOA/hAJa/7saGgEQ==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/pluginutils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.1.tgz", + "integrity": "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/@types/estree": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz", + "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==", + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "26.6.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-26.6.5.tgz", + "integrity": "sha512-uMzsv9stDdofIZBx4UGh4Z9ZgXnGC9seRDscilBcTHAeOFk67MZg/k9bWVfO+bk4qZmG+l52hRnLwUiH2LnJTg==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "undici-types": "~8.9.0" + } + }, + "node_modules/@vitejs/plugin-vue": { + "version": "6.0.10", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-6.0.10.tgz", + "integrity": "sha512-b80aUQh3n+qEzzZm5oQp3rT2QImeCx58K6eFl/RkJ3d65KW0kTuv5lNsLRVAjbW9YRUpo/wzmvzMgV34bTAItA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@rolldown/pluginutils": "^1.0.1" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "peerDependencies": { + "vite": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0", + "vue": "^3.2.25 || ^3.6.0-rc.10" + } + }, + "node_modules/@volar/language-core": { + "version": "2.4.28", + "resolved": "https://registry.npmjs.org/@volar/language-core/-/language-core-2.4.28.tgz", + "integrity": "sha512-w4qhIJ8ZSitgLAkVay6AbcnC7gP3glYM3fYwKV3srj8m494E3xtrCv6E+bWviiK/8hs6e6t1ij1s2Endql7vzQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@volar/source-map": "2.4.28" + } + }, + "node_modules/@volar/source-map": { + "version": "2.4.28", + "resolved": "https://registry.npmjs.org/@volar/source-map/-/source-map-2.4.28.tgz", + "integrity": "sha512-yX2BDBqJkRXfKw8my8VarTyjv48QwxdJtvRgUpNE5erCsgEUdI2DsLbpa+rOQVAJYshY99szEcRDmyHbF10ggQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@volar/typescript": { + "version": "2.4.28", + "resolved": "https://registry.npmjs.org/@volar/typescript/-/typescript-2.4.28.tgz", + "integrity": "sha512-Ja6yvWrbis2QtN4ClAKreeUZPVYMARDYZl9LMEv1iQ1QdepB6wn0jTRxA9MftYmYa4DQ4k/DaSZpFPUfxl8giw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@volar/language-core": "2.4.28", + "path-browserify": "^1.0.1", + "vscode-uri": "^3.0.8" + } + }, + "node_modules/@vue-macros/common": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/@vue-macros/common/-/common-3.1.4.tgz", + "integrity": "sha512-/5Fv+6DgIcM9ajY05ZmKBv+LMX1M9A0X+IUwDRVdt67ciw8OV9bvG2r34p3RiEadlsQybjhKPRKNXDC8Bp23cw==", + "license": "MIT", + "dependencies": { + "@vue/compiler-sfc": "^3.5.22", + "ast-kit": "^2.1.2", + "local-pkg": "^1.1.2", + "magic-string-ast": "^1.0.2", + "unplugin-utils": "^0.3.0" + }, + "engines": { + "node": ">=20.19.0" + }, + "funding": { + "url": "https://github.com/sponsors/vue-macros" + }, + "peerDependencies": { + "vue": "^2.7.0 || ^3.2.25" + }, + "peerDependenciesMeta": { + "vue": { + "optional": true + } + } + }, + "node_modules/@vue/compiler-core": { + "version": "3.5.44", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.5.44.tgz", + "integrity": "sha512-k34nCytbK8PQ1gR2mGROYOw6Pnv/mumqIdrZ3x2tbyXZDWm7ViKGLTfdB+DRrWqEQsLgGJvn0WN9jBif5zCTLQ==", + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.29.9", + "@vue/shared": "3.5.44", + "entities": "^7.0.1", + "estree-walker": "^2.0.2", + "source-map-js": "^1.2.2" + } + }, + "node_modules/@vue/compiler-dom": { + "version": "3.5.44", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.5.44.tgz", + "integrity": "sha512-W5AoBFWdw1lQAKiHowkfgFKFab82oSRT6sGsPfw/q1GRjsy/ZJFLHGhJyBRIFN9APLTUduDH9U2JAiPOIyKuYg==", + "license": "MIT", + "dependencies": { + "@vue/compiler-core": "3.5.44", + "@vue/shared": "3.5.44" + } + }, + "node_modules/@vue/compiler-sfc": { + "version": "3.5.44", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.5.44.tgz", + "integrity": "sha512-dzHmQ4jXTpdr5FjIQUeykVakN/uzqFbUo9/C5ikBFg3a3PeM6uRxeczx1ZbXBML0/zJstEh3ygYipzR5Z7b2Pw==", + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.29.9", + "@vue/compiler-core": "3.5.44", + "@vue/compiler-dom": "3.5.44", + "@vue/compiler-ssr": "3.5.44", + "@vue/shared": "3.5.44", + "estree-walker": "^2.0.2", + "magic-string": "^0.30.21", + "postcss": "^8.5.29", + "source-map-js": "^1.2.2" + } + }, + "node_modules/@vue/compiler-ssr": { + "version": "3.5.44", + "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.5.44.tgz", + "integrity": "sha512-xr5gb1JVHlfXJwSlRz1FeP6uxoazdzHuMTVLE7up+4Vrqxk219CvxLPxD9NXBt47yvZW7+p4DXfyp4O1fkByIA==", + "license": "MIT", + "dependencies": { + "@vue/compiler-dom": "3.5.44", + "@vue/shared": "3.5.44" + } + }, + "node_modules/@vue/devtools-api": { + "version": "8.2.1", + "resolved": "https://registry.npmjs.org/@vue/devtools-api/-/devtools-api-8.2.1.tgz", + "integrity": "sha512-6u4vXBlIBAC1wMplIZgpyPn7uh/s4Bf6F5bMzvLv+EdJ0aHs/+4B7Ygv864EStQSjRbsRzTko/kUG1A1IejQ3A==", + "license": "MIT", + "dependencies": { + "@vue/devtools-kit": "^8.2.1" + } + }, + "node_modules/@vue/devtools-kit": { + "version": "8.2.1", + "resolved": "https://registry.npmjs.org/@vue/devtools-kit/-/devtools-kit-8.2.1.tgz", + "integrity": "sha512-FIGIuq3AWReEpbAHY/cRGeHDfI0qOb8OCQ3YjbEAX04uaxIDbGc9rhkbVcG7rnfHPXE3RsU5KrWOu9V/okd8AQ==", + "license": "MIT", + "dependencies": { + "@vue/devtools-shared": "^8.2.1", + "birpc": "^2.6.1", + "hookable": "^5.5.3", + "perfect-debounce": "^2.0.0" + } + }, + "node_modules/@vue/devtools-shared": { + "version": "8.2.1", + "resolved": "https://registry.npmjs.org/@vue/devtools-shared/-/devtools-shared-8.2.1.tgz", + "integrity": "sha512-Fkac7lUdGReh6pVOi3AYPRGe82LQqRmAfThW7RRligOAP0ZA/Z1z9XLHDM9dv34pV2HRc79DK8uKPeG2fLnA/g==", + "license": "MIT" + }, + "node_modules/@vue/language-core": { + "version": "3.3.13", + "resolved": "https://registry.npmjs.org/@vue/language-core/-/language-core-3.3.13.tgz", + "integrity": "sha512-axA0Xemn5LuUKuKWob0/kVq7xQ2mJJM6VqA9Exvt35nM9yRC31goWVve/G/Zb2ZCLsXC8FHYjjfXlnshknSCew==", + "dev": true, + "license": "MIT", + "dependencies": { + "@volar/language-core": "2.4.28", + "@vue/compiler-dom": "^3.5.0", + "@vue/shared": "^3.5.0", + "alien-signals": "^3.2.1", + "muggle-string": "^0.4.1", + "path-browserify": "^1.0.1", + "picomatch": "^4.0.4" + } + }, + "node_modules/@vue/reactivity": { + "version": "3.5.44", + "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.5.44.tgz", + "integrity": "sha512-u+QJdKeBBEADkPdevsL+6E12QlYVfBD8Zcw5qjDQKtamI6l14KyqazJMobhCKelhWN5zpyKUiEDoTyHE93cqWw==", + "license": "MIT", + "dependencies": { + "@vue/shared": "3.5.44" + } + }, + "node_modules/@vue/runtime-core": { + "version": "3.5.44", + "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.5.44.tgz", + "integrity": "sha512-uEa/ndwjhrrhnOfb2p+sZy6zeoamJOISqaLSJGk/8R6nABT1ZldpzcJoPzKj+zHVomVBPcmQYyC2r4LtvDV6CQ==", + "license": "MIT", + "dependencies": { + "@vue/reactivity": "3.5.44", + "@vue/shared": "3.5.44" + } + }, + "node_modules/@vue/runtime-dom": { + "version": "3.5.44", + "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.5.44.tgz", + "integrity": "sha512-3fc4ARcXVhVBaJ3ujWiNZJARD6pkyRcwG+ZYhMzjKtKUp7MAY0HLwr7r3Smep3Li6ZaWT6ewdmx8XqdaD5oNZg==", + "license": "MIT", + "dependencies": { + "@vue/reactivity": "3.5.44", + "@vue/runtime-core": "3.5.44", + "@vue/shared": "3.5.44", + "csstype": "^3.2.3" + } + }, + "node_modules/@vue/server-renderer": { + "version": "3.5.44", + "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.5.44.tgz", + "integrity": "sha512-R4S1UoH4h5Frrauv8Z5XE5TxV9oBiUSgWIC4TyVK1FK+RocRnOLwFA5Xcmo2011RlgJp+AbZCnw6afrhlgRuUQ==", + "license": "MIT", + "dependencies": { + "@vue/compiler-ssr": "3.5.44", + "@vue/runtime-dom": "3.5.44", + "@vue/shared": "3.5.44" + } + }, + "node_modules/@vue/shared": { + "version": "3.5.44", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.5.44.tgz", + "integrity": "sha512-H82XLH0DjmSOdbEwO15x3QTo1f5PWEtv237eLpYKc0mqLu+B8hnq16lFWmuBmNurkeiG3wr+oM1FhOll/YVFRg==", + "license": "MIT" + }, + "node_modules/acorn": { + "version": "8.19.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.19.0.tgz", + "integrity": "sha512-oJlA3XiRm7Cyk6qFD2Jn8ak9B7jSy0qy00ADO3+8dpT0LSjFihQYv4C02LFCSYJV3Q37xYwwRy5m+IpIiUzqWw==", + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/alien-signals": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/alien-signals/-/alien-signals-3.2.1.tgz", + "integrity": "sha512-I8FjmltrfnDFoZedi5CG8DghVYNhzb/Ijluz7tCSJH0xpd0484Kowhbb1XDYOxfJpU1p5wnM2X54dA+IfGyD1g==", + "dev": true, + "license": "MIT" + }, + "node_modules/ast-kit": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/ast-kit/-/ast-kit-2.2.0.tgz", + "integrity": "sha512-m1Q/RaVOnTp9JxPX+F+Zn7IcLYMzM8kZofDImfsKZd8MbR+ikdOzTeztStWqfrqIxZnYWryyI9ePm3NGjnZgGw==", + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.28.5", + "pathe": "^2.0.3" + }, + "engines": { + "node": ">=20.19.0" + }, + "funding": { + "url": "https://github.com/sponsors/sxzz" + } + }, + "node_modules/ast-walker-scope": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/ast-walker-scope/-/ast-walker-scope-0.10.0.tgz", + "integrity": "sha512-KzvoxDfXNz2Gm8KYLh47K3qcY3Zza3WKOuh2xoqa7LBu6MDKWAZLovJtU9DuAd/Er+rhQHCRn619lHS5U+qmhw==", + "license": "MIT", + "dependencies": { + "@babel/parser": "^8.0.0", + "@babel/types": "^8.0.0", + "ast-kit": "^3.0.0" + }, + "engines": { + "node": "^22.18.0 || >=24.11.0" + }, + "funding": { + "url": "https://github.com/sponsors/sxzz" + } + }, + "node_modules/ast-walker-scope/node_modules/@babel/helper-string-parser": { + "version": "8.0.6", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-8.0.6.tgz", + "integrity": "sha512-+6HYEBnsDRZHJtUTAEfMQd0zMDqdFHS7C+5vAsEZqBUr3vEMWOWlHJ0Jz1gS8jJIlCvLsuA6ivmeoqzH936YcA==", + "license": "MIT", + "engines": { + "node": "^22.18.0 || >=24.11.0" + } + }, + "node_modules/ast-walker-scope/node_modules/@babel/helper-validator-identifier": { + "version": "8.0.6", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-8.0.6.tgz", + "integrity": "sha512-HYx0YmuchRxRSpnjvcNffnPS8DCauKNmnumIuHG3jnQAVewRA7kfJGwF13ayEpSZs7s4R/oBH4eppuXcAQd5JQ==", + "license": "MIT", + "engines": { + "node": "^22.18.0 || >=24.11.0" + } + }, + "node_modules/ast-walker-scope/node_modules/@babel/parser": { + "version": "8.0.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-8.0.7.tgz", + "integrity": "sha512-UkDwEbPO1px2JQSrdh4qIgaH1JgG7GO/pFeJkpxhDxIETkT/QvGpnigXIw75ViHYPtIgKITmVUJqLjiO+JuWjA==", + "license": "MIT", + "dependencies": { + "@babel/types": "^8.0.6" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": "^22.18.0 || >=24.11.0" + } + }, + "node_modules/ast-walker-scope/node_modules/@babel/types": { + "version": "8.0.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-8.0.6.tgz", + "integrity": "sha512-c+xgSWboV2pdwXP67BUWDVRHi2BO5Q3KwxyFVs7taVTY+fsK47/L51ZXQoV9rozHJDNHvJ4v4WEsI/IlxV2l2A==", + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^8.0.6", + "@babel/helper-validator-identifier": "^8.0.6" + }, + "engines": { + "node": "^22.18.0 || >=24.11.0" + } + }, + "node_modules/ast-walker-scope/node_modules/ast-kit": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ast-kit/-/ast-kit-3.0.0.tgz", + "integrity": "sha512-8OG92q3R35qjC/4i6BLBMg8IB+fClWu/1PEwg2Z9Rn+BuNaiEgJzpzn+pxWOdHJWDCAwu2JP0wCDTozAM4QirQ==", + "license": "MIT", + "dependencies": { + "@babel/parser": "^8.0.0", + "estree-walker": "^3.0.3", + "pathe": "^2.0.3" + }, + "engines": { + "node": "^22.18.0 || >=24.11.0" + }, + "funding": { + "url": "https://github.com/sponsors/sxzz" + } + }, + "node_modules/ast-walker-scope/node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0" + } + }, + "node_modules/birpc": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/birpc/-/birpc-2.9.0.tgz", + "integrity": "sha512-KrayHS5pBi69Xi9JmvoqrIgYGDkD6mcSe/i6YKi3w5kekCLzrX4+nawcXqrj2tIp50Kw/mT/s3p+GVK0A0sKxw==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/chokidar": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-5.0.0.tgz", + "integrity": "sha512-TQMmc3w+5AxjpL8iIiwebF73dRDF4fBIieAqGn9RGCWaEVwQ6Fb2cGe31Yns0RRIzii5goJ1Y7xbMwo1TxMplw==", + "license": "MIT", + "dependencies": { + "readdirp": "^5.0.0" + }, + "engines": { + "node": ">= 20.19.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/confbox": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.3.1.tgz", + "integrity": "sha512-cKUSoKa8YxFZZSmraVi7onONx3amu77ngK3kGpsYHDH7drPwCRkQE1RYMPlLRrMtnciRj274XNRxcHxnKmDSnA==", + "license": "MIT" + }, + "node_modules/csstype": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", + "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", + "license": "MIT" + }, + "node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "devOptional": true, + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, + "node_modules/entities": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-7.0.1.tgz", + "integrity": "sha512-TWrgLOFUQTH994YUyl1yT4uyavY5nNB5muff+RtWaqNVCAK408b5ZnnbNAUEWLTCpum9w6arT70i1XdQ4UeOPA==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "license": "MIT" + }, + "node_modules/exsolve": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/exsolve/-/exsolve-1.1.3.tgz", + "integrity": "sha512-kuzL9zherLQoqDeQaS55AiiIg1kb4KYXaSusTtgZTPlvKP2gGCI82LNmBNh5RjDVUXIcmgx+/Mx7vPwRzBbhJA==", + "license": "MIT" + }, + "node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/hookable": { + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/hookable/-/hookable-5.5.3.tgz", + "integrity": "sha512-Yc+BQe8SvoXH1643Qez1zqLRmbA5rCL+sSmk6TVos0LWVfNIB7PGncdlId77WzLGSIB5KaWgTaNTs2lNVEI6VQ==", + "license": "MIT" + }, + "node_modules/lightningcss": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.33.0.tgz", + "integrity": "sha512-WkUDrojuJs0xkgGf2udWxa3yGBRxPtxUkB79i6aCZLRgc7PM8fZe9TosfPDcvEpQZbuFASnHYmRLBLUbmLOIIA==", + "devOptional": true, + "license": "MPL-2.0", + "dependencies": { + "detect-libc": "^2.0.3" + }, + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "lightningcss-android-arm64": "1.33.0", + "lightningcss-darwin-arm64": "1.33.0", + "lightningcss-darwin-x64": "1.33.0", + "lightningcss-freebsd-x64": "1.33.0", + "lightningcss-linux-arm-gnueabihf": "1.33.0", + "lightningcss-linux-arm64-gnu": "1.33.0", + "lightningcss-linux-arm64-musl": "1.33.0", + "lightningcss-linux-x64-gnu": "1.33.0", + "lightningcss-linux-x64-musl": "1.33.0", + "lightningcss-win32-arm64-msvc": "1.33.0", + "lightningcss-win32-x64-msvc": "1.33.0" + } + }, + "node_modules/lightningcss-android-arm64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.33.0.tgz", + "integrity": "sha512-gEpRTalKdosp4Bb8qWtc2iOgE5SeIHlpS1up9bFq2wAyYhl1UdTObYiHe98zEM9SQvSoqQZ1IQD0JNpg3Ml5pg==", + "cpu": [ + "arm64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-arm64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.33.0.tgz", + "integrity": "sha512-Sciaz8eenNTKn9b3t7+xr0ipTp9YxKQY4npwQ3mrRuL0BAVHBLyZxofhaKBAVtzmtRZ/zTyo0/to4B1uWG/Djg==", + "cpu": [ + "arm64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-x64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.33.0.tgz", + "integrity": "sha512-Z5UPAxzrjlWNNyGy6i65cJzzvgJ5D3T6wMvs+gWpY9d7qRhANrxqAp6LhxIgZhWEw18RfJTGcRxjuLIBr+m8XQ==", + "cpu": [ + "x64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-freebsd-x64": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.33.0.tgz", + "integrity": "sha512-QQM/Ti/hQajJwCY+RiWuCZ9sdtI/XQk7nDK5vC8kkdwixezOlDgvDx7+RT+QjK6FcFT4MpsuoBnHIo/O3StRRg==", + "cpu": [ + "x64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm-gnueabihf": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.33.0.tgz", + "integrity": "sha512-N7FVBe6iS24MlM6R/4RBTxGhQheZGs7tiQ9U32UtF75NzP5Q7xWPRqLBCKxlRQRk3rY1jCIPLzx7WzOhuUIRLQ==", + "cpu": [ + "arm" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-gnu": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.33.0.tgz", + "integrity": "sha512-j2v/itmy4HlNxlc6voKXYgBqNi0Ng2LShg4z7GufpEgs05P+2suBVyi9I6YHq5uoVFx9ETin3eCEhLVyXGQnKg==", + "cpu": [ + "arm64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-musl": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.33.0.tgz", + "integrity": "sha512-yiO5ROMuYQgXbC60yjZU5CYSFZGKXL0HFATXt9mHJn1+zW55oCtMI9NfcVhYLMFDL7gV7oBPon/EmMMGg2OvtQ==", + "cpu": [ + "arm64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-gnu": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.33.0.tgz", + "integrity": "sha512-ar+Ju7LmcN0Jo4FpL4hpFybwNG9/3A/Br5KW2n2jyODg3MEZXaDYADdemoNS+BDNfMgKvylJLj4S5tyRActuAg==", + "cpu": [ + "x64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-musl": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.33.0.tgz", + "integrity": "sha512-RYiYbkokw0trfKqqzfF55lginwEPrD3OJDfTuJzFs1MK6iFnDenaz1fqLLtX4ITG3OktJQXOeTaw1awrBAlZPw==", + "cpu": [ + "x64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-arm64-msvc": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.33.0.tgz", + "integrity": "sha512-1K+MPfLSFVpphzpdbfkhlWk6wBrTObBzS2T6db10PNOZgR9GoVsAWzwNyuhUYYbTp23j+4RrncfujZ4uAzXvwA==", + "cpu": [ + "arm64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-x64-msvc": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.33.0.tgz", + "integrity": "sha512-OlEICDx/Xl0FqSp4bry8zFnCvGpig3Gl4gCquvYwHuqJKEC1+n9NgDniFvqHGmMv1ZkqDJrDqKKSykTDX+ehuA==", + "cpu": [ + "x64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/local-pkg": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-1.2.1.tgz", + "integrity": "sha512-++gUqRDEvcnN6Zhqrr+y/CkVEHhlrR96vZn3nZZPYzMcBUyBtTKzB9NadClFIsIVSsu+3i9tfk/erqy9kAmt7Q==", + "license": "MIT", + "dependencies": { + "mlly": "^1.7.4", + "pkg-types": "^2.3.0", + "quansync": "^0.2.11" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/magic-string-ast": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/magic-string-ast/-/magic-string-ast-1.0.3.tgz", + "integrity": "sha512-CvkkH1i81zl7mmb94DsRiFeG9V2fR2JeuK8yDgS8oiZSFa++wWLEgZ5ufEOyLHbvSbD1gTRKv9NdX69Rnvr9JA==", + "license": "MIT", + "dependencies": { + "magic-string": "^0.30.19" + }, + "engines": { + "node": ">=20.19.0" + }, + "funding": { + "url": "https://github.com/sponsors/sxzz" + } + }, + "node_modules/mlly": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.8.2.tgz", + "integrity": "sha512-d+ObxMQFmbt10sretNDytwt85VrbkhhUA/JBGm1MPaWJ65Cl4wOgLaB1NYvJSZ0Ef03MMEU/0xpPMXUIQ29UfA==", + "license": "MIT", + "dependencies": { + "acorn": "^8.16.0", + "pathe": "^2.0.3", + "pkg-types": "^1.3.1", + "ufo": "^1.6.3" + } + }, + "node_modules/mlly/node_modules/confbox": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.1.8.tgz", + "integrity": "sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==", + "license": "MIT" + }, + "node_modules/mlly/node_modules/pkg-types": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.3.1.tgz", + "integrity": "sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ==", + "license": "MIT", + "dependencies": { + "confbox": "^0.1.8", + "mlly": "^1.7.4", + "pathe": "^2.0.1" + } + }, + "node_modules/muggle-string": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/muggle-string/-/muggle-string-0.4.1.tgz", + "integrity": "sha512-VNTrAak/KhO2i8dqqnqnAHOa3cYBwXEZe9h+D5h/1ZqFSTEFHdM65lR7RoIqq3tBBYavsOXV84NoHXZ0AkPyqQ==", + "license": "MIT" + }, + "node_modules/nanoid": { + "version": "3.3.20", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.20.tgz", + "integrity": "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==", + "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/nostics": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/nostics/-/nostics-1.3.0.tgz", + "integrity": "sha512-wzRsrJwNlFbqIRQt8aCeL2WE8USip/uuvGSOZV1D02CxX8ABTMbw8IywKjH7yWHETMXbWJI4OBpihg9rmz2Vyg==", + "license": "MIT" + }, + "node_modules/path-browserify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", + "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", + "dev": true, + "license": "MIT" + }, + "node_modules/pathe": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", + "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", + "license": "MIT" + }, + "node_modules/perfect-debounce": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/perfect-debounce/-/perfect-debounce-2.1.0.tgz", + "integrity": "sha512-LjgdTytVFXeUgtHZr9WYViYSM/g8MkcTPYDlPa3cDqMirHjKiSZPYd6DoL7pK8AJQr+uWkQvCjHNdiMqsrJs+g==", + "license": "MIT" + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.7.tgz", + "integrity": "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pkg-types": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-2.3.3.tgz", + "integrity": "sha512-j/lCFdcppV0JxWpCEITdbDltBxPP6cHT+yNJ6Go2OgoSA9518X847X9z0p6LtA4Nc16+eQzCZjRrWanTGvHJ5w==", + "license": "MIT", + "dependencies": { + "confbox": "^0.3.1", + "exsolve": "^1.1.1", + "pathe": "^2.0.3" + } + }, + "node_modules/postcss": { + "version": "8.5.30", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.30.tgz", + "integrity": "sha512-zkd+e9S1AQHhmaBKye9zlFHWjOwVgqXl1q3ECYy8561K7qxR2cREf/STLskulBFd78k6AOFeA+ff1TtEzk9bAA==", + "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.20", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/quansync": { + "version": "0.2.11", + "resolved": "https://registry.npmjs.org/quansync/-/quansync-0.2.11.tgz", + "integrity": "sha512-AifT7QEbW9Nri4tAwR5M/uzpBuqfZf+zwaEM/QkzEjj7NBuFD2rBuy0K3dE+8wltbezDV7JMA0WfnCPYRSYbXA==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/antfu" + }, + { + "type": "individual", + "url": "https://github.com/sponsors/sxzz" + } + ], + "license": "MIT" + }, + "node_modules/readdirp": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-5.1.1.tgz", + "integrity": "sha512-Kko+Y5XQ6fM+Ce3dq3m9YGxnacYZYl9cA1wZjaF3Vbry2L3i1qVg8+CAgNPsXRArPMUMCaOR7oa9Nqntc43JKA==", + "license": "MIT", + "engines": { + "node": ">= 20.19.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/rolldown": { + "version": "1.2.14", + "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.2.14.tgz", + "integrity": "sha512-eTBTTqMR6uHKLgcUqpJP8ntzDI6V4LYA8negAMBEI7gkgVvOdrx6VsvS2Ym+83KhOPdLCHWJu0w7UQFJZhHKNw==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "@oxc-project/types": "=0.154.0", + "@rolldown/pluginutils": "^1.0.0" + }, + "bin": { + "rolldown": "bin/cli.mjs" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "optionalDependencies": { + "@rolldown/binding-android-arm-eabi": "1.2.14", + "@rolldown/binding-android-arm64": "1.2.14", + "@rolldown/binding-darwin-arm64": "1.2.14", + "@rolldown/binding-darwin-x64": "1.2.14", + "@rolldown/binding-freebsd-x64": "1.2.14", + "@rolldown/binding-linux-arm-gnueabihf": "1.2.14", + "@rolldown/binding-linux-arm64-gnu": "1.2.14", + "@rolldown/binding-linux-arm64-musl": "1.2.14", + "@rolldown/binding-linux-ppc64-gnu": "1.2.14", + "@rolldown/binding-linux-s390x-gnu": "1.2.14", + "@rolldown/binding-linux-x64-gnu": "1.2.14", + "@rolldown/binding-linux-x64-musl": "1.2.14", + "@rolldown/binding-openharmony-arm64": "1.2.14", + "@rolldown/binding-win32-arm64-msvc": "1.2.14", + "@rolldown/binding-win32-x64-msvc": "1.2.14" + } + }, + "node_modules/scule": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/scule/-/scule-1.3.0.tgz", + "integrity": "sha512-6FtHJEvt+pVMIB9IBY+IcCJ6Z5f1iQnytgyfKMhDKgmzYG+TeH/wx1y3l27rshSbLiSanrR9ffZDrEsmjlQF2g==", + "license": "MIT" + }, + "node_modules/source-map-js": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.2.tgz", + "integrity": "sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/tinyglobby": { + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", + "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==", + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.4" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "devOptional": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/ufo": { + "version": "1.6.4", + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.6.4.tgz", + "integrity": "sha512-JFNbkD1Svwe0KvGi8GOeLcP4kAWQ609twvCdcHxq1oSL8svv39ZuSvajcD8B+5D0eL4+s1Is2D/O6KN3qcTeRA==", + "license": "MIT" + }, + "node_modules/undici-types": { + "version": "8.9.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.9.0.tgz", + "integrity": "sha512-KTDyRTYX8sWmKXAikPHHSyc63CRPETMctyjKFupcC6OBLXT3xsN0e9aF7m+mIXutFWpUXuedtowG7iLOzp0kQg==", + "devOptional": true, + "license": "MIT" + }, + "node_modules/unplugin": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/unplugin/-/unplugin-3.4.0.tgz", + "integrity": "sha512-9skdIFlCsPdFV7wUfZxNsFInlW+7nJmGu2gkTu0OUhF56aXGsHab9x52/QhdJ4lC7ZDPWTxbiC4ANqVlsuaW3w==", + "license": "MIT", + "dependencies": { + "@jridgewell/remapping": "^2.3.5", + "picomatch": "^4.0.7", + "webpack-virtual-modules": "^0.6.2" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "peerDependencies": { + "@farmfe/core": "*", + "@rsbuild/core": "*", + "@rspack/core": "*", + "bun-types-no-globals": "*", + "esbuild": "*", + "rolldown": "*", + "rollup": "*", + "unloader": "*", + "vite": "*", + "webpack": "*" + }, + "peerDependenciesMeta": { + "@farmfe/core": { + "optional": true + }, + "@rsbuild/core": { + "optional": true + }, + "@rspack/core": { + "optional": true + }, + "bun-types-no-globals": { + "optional": true + }, + "esbuild": { + "optional": true + }, + "rolldown": { + "optional": true + }, + "rollup": { + "optional": true + }, + "unloader": { + "optional": true + }, + "vite": { + "optional": true + }, + "webpack": { + "optional": true + } + } + }, + "node_modules/unplugin-utils": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/unplugin-utils/-/unplugin-utils-0.3.2.tgz", + "integrity": "sha512-xVToRh2CTmLk2HnEG7ac4rl1MJTT3RFkpS8B++/SnB0kXvuaavD+n3m/vrzyWQOdJNSZQACnbz01pnppbwV5BA==", + "license": "MIT", + "dependencies": { + "pathe": "^2.0.3", + "picomatch": "^4.0.4" + }, + "engines": { + "node": ">=20.19.0" + }, + "funding": { + "url": "https://github.com/sponsors/sxzz" + } + }, + "node_modules/vite": { + "version": "8.3.4", + "resolved": "https://registry.npmjs.org/vite/-/vite-8.3.4.tgz", + "integrity": "sha512-IftLE8phJhdNRIGNEV4JCCvfNScoZQVfcXaN8TQropWGJtOHcu+iAB9pHcuGvmEb/kddw0LBe/jS8ztdC6xdiQ==", + "devOptional": true, + "license": "MIT", + "dependencies": { + "lightningcss": "^1.33.0", + "picomatch": "^4.0.7", + "postcss": "^8.5.29", + "rolldown": "~1.2.12", + "tinyglobby": "^0.2.17" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^20.19.0 || >=22.12.0", + "@vitejs/devtools": "^0.7.1", + "esbuild": "^0.27.0 || ^0.28.0", + "jiti": ">=1.21.0", + "less": "^4.0.0", + "sass": "^1.70.0", + "sass-embedded": "^1.70.0", + "stylus": ">=0.54.8", + "sugarss": "^5.0.0", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "@vitejs/devtools": { + "optional": true + }, + "esbuild": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/vscode-uri": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.2.0.tgz", + "integrity": "sha512-m2gXo3bn0G1kT9InzMf07fTbqMbGtyckj3bH5ktLO+1Ssv+yiATZ4dhwaQv9UZWxJh6E9IFGnQyjgWVDWVBDrg==", + "dev": true, + "license": "MIT" + }, + "node_modules/vue": { + "version": "3.5.44", + "resolved": "https://registry.npmjs.org/vue/-/vue-3.5.44.tgz", + "integrity": "sha512-dvvmaOCG7lAMkJTPqPwWeGMsPS6DIsFsfZDUgBp9V6mHf9b3+/wyVwYR4Es+WV6uJC0FKRxp81Obcq0ZwUcGFQ==", + "license": "MIT", + "dependencies": { + "@vue/compiler-dom": "3.5.44", + "@vue/compiler-sfc": "3.5.44", + "@vue/runtime-dom": "3.5.44", + "@vue/server-renderer": "3.5.44", + "@vue/shared": "3.5.44" + }, + "peerDependencies": { + "typescript": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/vue-router": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-5.4.0.tgz", + "integrity": "sha512-pFvcYcxinDHjZUlf7AzFBrT8r8Xqvv4uMHoJnjc+EqPawXQvHTkF8S4tfSmQLpriVHUGfkaKlI7Et0KRjTMTdw==", + "license": "MIT", + "dependencies": { + "@vue-macros/common": "^3.1.3", + "@vue/devtools-api": "^8.1.5", + "ast-walker-scope": "^0.10.0", + "chokidar": "^5.0.0", + "confbox": "^0.3.1", + "local-pkg": "^1.2.1", + "magic-string": "^1.4.3", + "mlly": "^1.8.2", + "muggle-string": "^0.4.1", + "nostics": "^1.3.0", + "pathe": "^2.0.3", + "picomatch": "^4.0.7", + "scule": "^1.3.0", + "tinyglobby": "^0.2.17", + "unplugin": "^3.4.0", + "unplugin-utils": "^0.3.2" + }, + "funding": { + "url": "https://github.com/sponsors/posva" + }, + "peerDependencies": { + "@pinia/colada": ">=0.21.2", + "@vue/compiler-sfc": "^3.5.34 || ^4.0.0", + "pinia": "^3.0.4 || ^4.0.2", + "vite": "^7.3.0 || ^8.0.0", + "vue": "^3.5.34 || ^4.0.0" + }, + "peerDependenciesMeta": { + "@pinia/colada": { + "optional": true + }, + "@vue/compiler-sfc": { + "optional": true + }, + "pinia": { + "optional": true + }, + "vite": { + "optional": true + } + } + }, + "node_modules/vue-router/node_modules/magic-string": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-1.4.3.tgz", + "integrity": "sha512-z12OxmaPGE0F4xlpGdjuAUckipLpQlTAuAmyGhNoD7ODpYUzvDfvtxUbjM/jwznyP178oju/KDdyi220wNJ0RQ==", + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.6.0" + } + }, + "node_modules/vue-tsc": { + "version": "3.3.13", + "resolved": "https://registry.npmjs.org/vue-tsc/-/vue-tsc-3.3.13.tgz", + "integrity": "sha512-jE4/bXdOMSHVxEGgQCqNllJy+9N3Gx6tfSAsg0yhFK/MAN6eXqISihupnDEKSCt12VVnjN2gI3AqLYcqoh5x/A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@volar/typescript": "2.4.28", + "@vue/language-core": "3.3.13" + }, + "bin": { + "vue-tsc": "bin/vue-tsc.js" + }, + "peerDependencies": { + "typescript": ">=5.0.0" + } + }, + "node_modules/webpack-virtual-modules": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/webpack-virtual-modules/-/webpack-virtual-modules-0.6.2.tgz", + "integrity": "sha512-66/V2i5hQanC51vBQKPH4aI8NMAcBW59FVBs+rC7eGHupMyfn34q7rZIE+ETlJ+XTevqfUhVVBgSUNSW2flEUQ==", + "license": "MIT" + } + } +} diff --git a/frontend/package.json b/frontend/package.json new file mode 100644 index 0000000..d130495 --- /dev/null +++ b/frontend/package.json @@ -0,0 +1,24 @@ +{ + "name": "pack-service-frontend", + "version": "1.0.0", + "private": true, + "type": "module", + "scripts": { + "dev": "vite", + "build": "vue-tsc --noEmit && vite build", + "build:only": "vite build", + "preview": "vite preview", + "typecheck": "vue-tsc --noEmit" + }, + "dependencies": { + "vue": "^3.5.44", + "vue-router": "^5.4.0" + }, + "devDependencies": { + "@types/node": "^26.6.5", + "@vitejs/plugin-vue": "^6.0.10", + "typescript": "^5.9.3", + "vite": "^8.3.4", + "vue-tsc": "^3.3.13" + } +} diff --git a/frontend/src/App.vue b/frontend/src/App.vue new file mode 100644 index 0000000..165d62c --- /dev/null +++ b/frontend/src/App.vue @@ -0,0 +1,7 @@ + + + diff --git a/frontend/src/api/client.ts b/frontend/src/api/client.ts new file mode 100644 index 0000000..48a0361 --- /dev/null +++ b/frontend/src/api/client.ts @@ -0,0 +1,75 @@ +/** + * 接口客户端:统一带上 `Authorization: Bearer `,统一处理 `{ ok, data, message }` 结构 + * + * 后端约定(见 backend/README): + * - 成功 `{ ok: true, data }`;失败 `{ ok: false, message, status? }` + * - 401 = 令牌缺失/过期/无效 → 清掉本地令牌并跳登录页 + */ +import { clearToken, getToken } from '@/composables/useAuth'; + +/** 开发时走 Vite 代理(同源 /api),生产时后端同源托管,所以默认空字符串即可 */ +const BASE = (import.meta.env.VITE_API_BASE as string | undefined) || ''; + +export interface ApiResult { + ok: boolean; + data?: T; + message?: string; + status?: string; +} + +export class ApiError extends Error { + status: number; + code?: string; + + constructor(message: string, status: number, code?: string) { + super(message); + this.status = status; + this.code = code; + } +} + +interface RequestOptions { + method?: 'GET' | 'POST' | 'PUT' | 'DELETE'; + body?: unknown; + /** 带上令牌(默认带;登录等公开接口可传 false) */ + auth?: boolean; +} + +async function request(path: string, options: RequestOptions = {}): Promise { + const { method = 'GET', body, auth = true } = options; + const headers: Record = {}; + if (body !== undefined) headers['Content-Type'] = 'application/json'; + if (auth) { + const token = getToken(); + if (token) headers.Authorization = `Bearer ${token}`; + } + + const res = await fetch(`${BASE}${path}`, { + method, + headers, + body: body === undefined ? undefined : JSON.stringify(body), + }); + + let payload: ApiResult | null = null; + try { + payload = (await res.json()) as ApiResult; + } catch { + payload = null; + } + + if (res.status === 401) { + clearToken(); + throw new ApiError(payload?.message || '登录已过期,请重新登录', 401, payload?.status); + } + if (!res.ok || !payload || payload.ok === false) { + throw new ApiError(payload?.message || `请求失败(${res.status})`, res.status, payload?.status); + } + return payload.data as T; +} + +export const api = { + get: (path: string, options?: Omit) => request(path, { ...options, method: 'GET' }), + post: (path: string, body?: unknown, options?: Omit) => request(path, { ...options, method: 'POST', body }), + put: (path: string, body?: unknown, options?: Omit) => request(path, { ...options, method: 'PUT', body }), + del: (path: string, body?: unknown, options?: Omit) => request(path, { ...options, method: 'DELETE', body }), +}; diff --git a/frontend/src/api/types.ts b/frontend/src/api/types.ts new file mode 100644 index 0000000..916c652 --- /dev/null +++ b/frontend/src/api/types.ts @@ -0,0 +1,101 @@ +/** + * 接口数据模型(与后端 `backend/app/controller/web/*` 的返回一一对应) + * + * 时间字段后端返回的是 ISO 字符串(JSON 序列化后的 Date),这里统一按 `string` 处理, + * 展示时用 `formatTime()`(`src/utils/format.ts`)格式化。 + */ + +/** 分页返回(后端 service 层的 { list, total, page, pageSize } 结构) */ +export interface Paged { + list: T[]; + total: number; + page: number; + pageSize: number; +} + +/** 设备(中控) */ +export interface Device { + id: number; + sn: string; + name?: string | null; + vendor?: string | null; + model?: string | null; + firmware?: string | null; + ip?: string | null; + userId?: number | null; + status: number; + lastRegisterAt?: string | null; + lastLoginAt?: string | null; + lastSeenAt?: string | null; + createdAt?: string; + updatedAt?: string; + /** 绑定的账号(只带展示字段) */ + user?: { id: number; username?: string | null; nickname?: string | null } | null; +} + +/** 中控通道 */ +export interface Channel { + id: number; + scannerId: number; + channelId: string; + channelName?: string | null; + lastReportAt?: string | null; + status: number; +} + +/** 扫码记录 */ +export interface ScanRecord { + id: number; + scannerId: number; + channelId: string; + barcode: string; + scanTime: string; + reportedAt?: string | null; + /** 后端拍平出来的所属设备(records 接口) */ + deviceSn?: string | null; + deviceName?: string | null; +} + +/** 首页统计 */ +export interface Stats { + deviceCount: number; + channelCount: number; + recordCount: number; + latestRecord: { + id: number; + barcode: string; + channelId: string; + deviceSn?: string | null; + scanTime: string; + } | null; +} + +/** 测试页:模拟设备扫码登录的返回(设备信息 + 长期 JWT) */ +export interface DeviceLoginResult extends Device { + token: string; + tokenType: string; + firstTime: boolean; +} + +/** 测试页:模拟中控上报的返回 */ +export interface ScanReportResult { + sn: string; + channelId: string; + channelName?: string; + barcode: string; + received: number; + inserted: number; + duplicated: number; + invalid: number; + channelCreated: number; + channelUpdated: number; +} + +/** 扫码登录码状态 */ +export interface WechatCodeStatus { + status: 'pending' | 'confirmed' | 'expired'; + code: string; + spm: string; + qrUrl: string; + expiresIn?: number; +} diff --git a/frontend/src/api/web.ts b/frontend/src/api/web.ts new file mode 100644 index 0000000..5fb5850 --- /dev/null +++ b/frontend/src/api/web.ts @@ -0,0 +1,114 @@ +/** + * web 用户端接口(`/api/web/*`)—— 只碰「自己的」数据,令牌由 `api/client.ts` 统一带上 + * + * 后端返回 `{ ok:true, data }`,失败会抛 `ApiError`(401 会自动清令牌)。 + */ +import { api } from '@/api/client'; +import type { + Channel, + Device, + DeviceLoginResult, + Paged, + ScanRecord, + ScanReportResult, + Stats, + WechatCodeStatus, +} from '@/api/types'; + +/** 首页统计 */ +export function fetchStats(): Promise { + return api.get('/api/web/stats'); +} + +/** 我的设备列表 */ +export function fetchDevices(params: { + page?: number; + pageSize?: number; + keyword?: string; + status?: number | ''; +} = {}): Promise> { + const query = new URLSearchParams(); + if (params.page) query.set('page', String(params.page)); + if (params.pageSize) query.set('pageSize', String(params.pageSize)); + if (params.keyword) query.set('keyword', params.keyword); + if (params.status !== undefined && params.status !== '') query.set('status', String(params.status)); + const qs = query.toString(); + return api.get>(`/api/web/devices${qs ? `?${qs}` : ''}`); +} + +/** 某台设备下已登记的通道 */ +export function fetchDeviceChannels(id: number): Promise<{ deviceId: number; list: Channel[] }> { + return api.get<{ deviceId: number; list: Channel[] }>(`/api/web/devices/${id}/channels`); +} + +/** 解绑设备(记录保留,设备可再扫码认领) */ +export function unbindDevice(id: number): Promise { + return api.post(`/api/web/devices/${id}/unbind`); +} + +/** 删除设备(软删除) */ +export function deleteDevice(id: number): Promise<{ id: number }> { + return api.del<{ id: number }>(`/api/web/devices/${id}`); +} + +/** 我的扫码记录 */ +export function fetchRecords(params: { + page?: number; + pageSize?: number; + deviceId?: number | ''; + channelId?: string; + barcode?: string; + startTime?: string; + endTime?: string; +} = {}): Promise> { + const query = new URLSearchParams(); + if (params.page) query.set('page', String(params.page)); + if (params.pageSize) query.set('pageSize', String(params.pageSize)); + if (params.deviceId !== undefined && params.deviceId !== '') query.set('deviceId', String(params.deviceId)); + if (params.channelId) query.set('channelId', params.channelId); + if (params.barcode) query.set('barcode', params.barcode); + if (params.startTime) query.set('startTime', params.startTime); + if (params.endTime) query.set('endTime', params.endTime); + const qs = query.toString(); + return api.get>(`/api/web/records${qs ? `?${qs}` : ''}`); +} + +// ---------------- 测试页:模拟真机链路 ---------------- + +/** 模拟「设备发码 → 有人扫码确认」:以当前登录账号为确认人建/取设备并换发长期 JWT */ +export function testDeviceLogin(body: { + sn?: string; + name?: string; + vendor?: string; + model?: string; + firmware?: string; + expiresIn?: string; +}): Promise { + return api.post('/api/web/test/device-login', body); +} + +/** 模拟「中控上报」(拿 SN + 长期 JWT,与真机同一套校验) */ +export function testScanReport(body: { + sn: string; + token: string; + channelId: string; + channelName?: string; + barcode: string; + scanTime?: string; +}): Promise { + return api.post('/api/web/test/scan', body); +} + +/** 查扫码登录码状态(公开接口,不需要登录) */ +export function fetchWechatStatus(codeOrSpm: string): Promise { + const query = new URLSearchParams( + codeOrSpm.includes('.') ? { spm: codeOrSpm } : { code: codeOrSpm }, + ); + return api.get(`/api/wechat/status?${query}`, { auth: false }); +} + +/** 模拟扫码授权:用当前登录账号确认某个登录码(小程序里就是这一步) */ +export function confirmWechatLogin(codeOrSpm: string): Promise<{ status: string; code: string; user: { id: number } }> { + const body = codeOrSpm.includes('.') ? { spm: codeOrSpm } : { code: codeOrSpm }; + return api.post<{ status: string; code: string; user: { id: number } }>('/api/wechat/confirm', body); +} diff --git a/frontend/src/components/AppLayout.vue b/frontend/src/components/AppLayout.vue new file mode 100644 index 0000000..5fa3215 --- /dev/null +++ b/frontend/src/components/AppLayout.vue @@ -0,0 +1,45 @@ + + + diff --git a/frontend/src/composables/useAuth.ts b/frontend/src/composables/useAuth.ts new file mode 100644 index 0000000..de548ba --- /dev/null +++ b/frontend/src/composables/useAuth.ts @@ -0,0 +1,57 @@ +import { ref } from 'vue'; + +/** 本地令牌与当前用户的存放(SPA 用 header 令牌,不依赖 cookie/session) */ +const TOKEN_KEY = 'packs_token'; +const USER_KEY = 'packs_user'; + +export interface CurrentUser { + id: number; + username?: string | null; + nickname?: string | null; + email?: string | null; + phone?: string | null; + avatar?: string | null; +} + +/** 当前用户(响应式,顶栏/个人中心用) */ +export const currentUser = ref(readUser()); + +function readUser(): CurrentUser | null { + try { + const raw = localStorage.getItem(USER_KEY); + return raw ? (JSON.parse(raw) as CurrentUser) : null; + } catch { + return null; + } +} + +export function getToken(): string { + return localStorage.getItem(TOKEN_KEY) || ''; +} + +export function setSession(token: string, user: CurrentUser): void { + localStorage.setItem(TOKEN_KEY, token); + localStorage.setItem(USER_KEY, JSON.stringify(user)); + currentUser.value = user; +} + +export function setUser(user: CurrentUser): void { + localStorage.setItem(USER_KEY, JSON.stringify(user)); + currentUser.value = user; +} + +export function clearToken(): void { + localStorage.removeItem(TOKEN_KEY); + localStorage.removeItem(USER_KEY); + currentUser.value = null; +} + +export function isLoggedIn(): boolean { + return Boolean(getToken()); +} + +/** 顶栏显示名 */ +export function displayName(user: CurrentUser | null = currentUser.value): string { + if (!user) return ''; + return user.nickname || user.username || `#${user.id}`; +} diff --git a/frontend/src/env.d.ts b/frontend/src/env.d.ts new file mode 100644 index 0000000..51c682d --- /dev/null +++ b/frontend/src/env.d.ts @@ -0,0 +1,7 @@ +/// + +declare module '*.vue' { + import type { DefineComponent } from 'vue'; + const component: DefineComponent, Record, unknown>; + export default component; +} diff --git a/frontend/src/main.ts b/frontend/src/main.ts new file mode 100644 index 0000000..a2d45ef --- /dev/null +++ b/frontend/src/main.ts @@ -0,0 +1,6 @@ +import { createApp } from 'vue'; +import App from './App.vue'; +import { router } from './router'; +import './styles/main.css'; + +createApp(App).use(router).mount('#app'); diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts new file mode 100644 index 0000000..484e06a --- /dev/null +++ b/frontend/src/router/index.ts @@ -0,0 +1,39 @@ +import { createRouter, createWebHistory, type RouteRecordRaw } from 'vue-router'; +import { getToken } from '@/composables/useAuth'; + +/** + * 路由表(meta.public = 不需要登录) + * + * 手机扫码打开的 `/wechat?spm=…` 也必须是公开路由(扫码的人可能还没登录)。 + */ +const routes: RouteRecordRaw[] = [ + { path: '/login', name: 'login', component: () => import('@/views/LoginView.vue'), meta: { public: true, bare: true } }, + { path: '/forgot', name: 'forgot', component: () => import('@/views/ForgotView.vue'), meta: { public: true, bare: true } }, + { path: '/reset', name: 'reset', component: () => import('@/views/ResetView.vue'), meta: { public: true, bare: true } }, + // 手机扫码后打开:确认登录(公开) + { path: '/wechat', name: 'wechat-confirm', component: () => import('@/views/WechatConfirmView.vue'), meta: { public: true, bare: true } }, + + { path: '/', name: 'home', component: () => import('@/views/HomeView.vue') }, + { path: '/devices', name: 'devices', component: () => import('@/views/DevicesView.vue') }, + { path: '/records', name: 'records', component: () => import('@/views/RecordsView.vue') }, + { path: '/profile', name: 'profile', component: () => import('@/views/ProfileView.vue') }, + { path: '/test', name: 'test', component: () => import('@/views/TestView.vue') }, + + { path: '/:pathMatch(.*)*', redirect: '/' }, +]; + +export const router = createRouter({ + history: createWebHistory(), + routes, +}); + +router.beforeEach((to) => { + const logged = Boolean(getToken()); + if (!to.meta.public && !logged) { + return { name: 'login', query: { redirect: to.fullPath } }; + } + if (to.meta.public && logged && to.name !== 'wechat-confirm') { + return { name: 'home' }; + } + return true; +}); diff --git a/frontend/src/styles/main.css b/frontend/src/styles/main.css new file mode 100644 index 0000000..3b85cf1 --- /dev/null +++ b/frontend/src/styles/main.css @@ -0,0 +1,312 @@ +:root { + --brand: #2563eb; + --brand-dark: #1d4ed8; + --text: #1f2430; + --text-muted: #6b7280; + --border: #e5e7eb; + --bg: #f6f7fb; + --card: #ffffff; + --danger: #dc2626; + --ok: #16a34a; + --radius: 10px; +} + +* { + box-sizing: border-box; +} + +html, +body, +#app { + height: 100%; + margin: 0; +} + +body { + background: var(--bg); + color: var(--text); + font: 14px/1.6 -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif; +} + +a { + color: var(--brand); + text-decoration: none; +} + +button { + font: inherit; +} + +.card { + background: var(--card); + border: 1px solid var(--border); + border-radius: var(--radius); + padding: 20px; +} + +.field { + display: flex; + flex-direction: column; + gap: 6px; + margin-bottom: 14px; +} + +.field > span { + color: var(--text-muted); + font-size: 13px; +} + +input, +select { + border: 1px solid var(--border); + border-radius: 8px; + padding: 9px 12px; + font: inherit; + outline: none; + background: #fff; +} + +input:focus, +select:focus { + border-color: var(--brand); + box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); +} + +.btn { + border: 0; + border-radius: 8px; + background: var(--brand); + color: #fff; + padding: 9px 16px; + cursor: pointer; +} + +.btn:hover { + background: var(--brand-dark); +} + +.btn:disabled { + opacity: 0.6; + cursor: not-allowed; +} + +.btn-ghost { + background: #fff; + color: var(--text); + border: 1px solid var(--border); +} + +.btn-danger { + background: var(--danger); +} + +.hint { + color: var(--text-muted); + font-size: 13px; +} + +.alert { + border-radius: 8px; + padding: 10px 12px; + margin-bottom: 14px; + font-size: 13px; +} + +.alert-error { + background: #fef2f2; + color: #b91c1c; + border: 1px solid #fecaca; +} + +.alert-ok { + background: #f0fdf4; + color: #15803d; + border: 1px solid #bbf7d0; +} + +/* 登录/找回密码这类「裸页」:居中卡片 */ +.bare-page { + min-height: 100%; + display: flex; + align-items: center; + justify-content: center; + padding: 24px; +} + +.bare-card { + width: 380px; + max-width: 100%; +} + +/* 业务页布局:左侧菜单 + 内容区 */ +.layout { + display: flex; + height: 100%; + overflow: hidden; +} + +.sidebar { + width: 210px; + flex: 0 0 210px; + background: #0f172a; + color: #cbd5e1; + display: flex; + flex-direction: column; +} + +.sidebar .brand { + padding: 18px 16px; + font-weight: 600; + color: #fff; + border-bottom: 1px solid rgba(255, 255, 255, 0.08); +} + +.sidebar nav { + flex: 1; + overflow-y: auto; + padding: 10px 8px; +} + +.sidebar nav a { + display: block; + padding: 9px 12px; + border-radius: 8px; + color: #cbd5e1; + margin-bottom: 2px; +} + +.sidebar nav a.router-link-active { + background: rgba(37, 99, 235, 0.9); + color: #fff; +} + +.sidebar .me { + border-top: 1px solid rgba(255, 255, 255, 0.08); + padding: 12px 16px; + font-size: 13px; +} + +.main { + flex: 1; + min-width: 0; + display: flex; + flex-direction: column; + overflow: hidden; +} + +.topbar { + height: 52px; + background: #fff; + border-bottom: 1px solid var(--border); + display: flex; + align-items: center; + padding: 0 20px; + justify-content: space-between; +} + +.content { + flex: 1; + min-height: 0; + overflow-y: auto; + padding: 20px; +} + +table { + width: 100%; + border-collapse: collapse; + background: #fff; +} + +th, +td { + text-align: left; + padding: 9px 12px; + border-bottom: 1px solid var(--border); + font-size: 13px; +} + +th { + background: #f9fafb; + color: var(--text-muted); + font-weight: 500; +} + +.muted { + color: var(--text-muted); +} + +/* ---------------- 列表页公共样式(设备管理 / 扫码记录) ---------------- */ + +.toolbar { + display: flex; + align-items: center; + gap: 8px; + margin-bottom: 14px; +} + +.toolbar-wrap { + flex-wrap: wrap; +} + +.table { + border: 1px solid var(--border); + border-radius: 8px; + overflow: hidden; +} + +.table th, +.table td { + vertical-align: middle; +} + +.table code { + font: 12px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; + background: #f3f4f6; + padding: 1px 5px; + border-radius: 5px; +} + +/* 展开的明细行(孩子表)+ 孩子表本身 */ +.row-detail > td { + background: #f9fafb; + padding: 0 12px 12px; +} + +.table-sub { + border: 1px solid var(--border); + border-radius: 6px; +} + +.pager { + display: flex; + align-items: center; + justify-content: flex-end; + gap: 10px; + margin-top: 14px; +} + +.btn-sm { + padding: 4px 10px; + font-size: 13px; + margin-right: 6px; +} + +.badge { + display: inline-block; + padding: 1px 8px; + border-radius: 999px; + font-size: 12px; + border: 1px solid transparent; +} + +.badge-ok { + color: #15803d; + background: #f0fdf4; + border-color: #bbf7d0; +} + +.badge-off { + color: #b91c1c; + background: #fef2f2; + border-color: #fecaca; +} diff --git a/frontend/src/utils/format.ts b/frontend/src/utils/format.ts new file mode 100644 index 0000000..bf10f36 --- /dev/null +++ b/frontend/src/utils/format.ts @@ -0,0 +1,32 @@ +/** 展示用的格式化小工具 */ + +/** ISO 字符串 / 时间戳 / Date → `2026-10-17 09:30:00`(空值显示占位符) */ +export function formatTime(value?: string | number | Date | null, fallback = '—'): string { + if (value === undefined || value === null || value === '') return fallback; + const date = new Date(value); + if (Number.isNaN(date.getTime())) return fallback; + + const pad = (num: number) => String(num).padStart(2, '0'); + return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}` + + ` ${pad(date.getHours())}:${pad(date.getMinutes())}:${pad(date.getSeconds())}`; +} + +/** 相对时间:`刚刚` / `3 分钟前` / ……(超过 30 天直接给日期) */ +export function fromNow(value?: string | null, fallback = '—'): string { + if (!value) return fallback; + const date = new Date(value); + if (Number.isNaN(date.getTime())) return fallback; + + const diff = Date.now() - date.getTime(); + if (diff < 60_000) return '刚刚'; + if (diff < 3_600_000) return `${Math.floor(diff / 60_000)} 分钟前`; + if (diff < 86_400_000) return `${Math.floor(diff / 3_600_000)} 小时前`; + if (diff < 2_592_000_000) return `${Math.floor(diff / 86_400_000)} 天前`; + return formatTime(date, fallback); +} + +/** 把 `YYYY-MM-DDTHH:mm`(datetime-local 的值)转成后端认的 `YYYY-MM-DD HH:mm:ss` */ +export function toApiTime(value: string): string { + if (!value) return ''; + return `${value.replace('T', ' ')}:00`.slice(0, 19); +} diff --git a/frontend/src/views/DevicesView.vue b/frontend/src/views/DevicesView.vue new file mode 100644 index 0000000..07d70b9 --- /dev/null +++ b/frontend/src/views/DevicesView.vue @@ -0,0 +1,179 @@ + + + diff --git a/frontend/src/views/ForgotView.vue b/frontend/src/views/ForgotView.vue new file mode 100644 index 0000000..f1f912d --- /dev/null +++ b/frontend/src/views/ForgotView.vue @@ -0,0 +1,66 @@ + + + + + diff --git a/frontend/src/views/HomeView.vue b/frontend/src/views/HomeView.vue new file mode 100644 index 0000000..bac5436 --- /dev/null +++ b/frontend/src/views/HomeView.vue @@ -0,0 +1,107 @@ + + + + + diff --git a/frontend/src/views/LoginView.vue b/frontend/src/views/LoginView.vue new file mode 100644 index 0000000..69f5d44 --- /dev/null +++ b/frontend/src/views/LoginView.vue @@ -0,0 +1,281 @@ + + + + + diff --git a/frontend/src/views/ProfileView.vue b/frontend/src/views/ProfileView.vue new file mode 100644 index 0000000..04fd344 --- /dev/null +++ b/frontend/src/views/ProfileView.vue @@ -0,0 +1,128 @@ + + + + + diff --git a/frontend/src/views/RecordsView.vue b/frontend/src/views/RecordsView.vue new file mode 100644 index 0000000..df52f7d --- /dev/null +++ b/frontend/src/views/RecordsView.vue @@ -0,0 +1,128 @@ + + + diff --git a/frontend/src/views/ResetView.vue b/frontend/src/views/ResetView.vue new file mode 100644 index 0000000..ef36a87 --- /dev/null +++ b/frontend/src/views/ResetView.vue @@ -0,0 +1,71 @@ + + + + + diff --git a/frontend/src/views/TestView.vue b/frontend/src/views/TestView.vue new file mode 100644 index 0000000..42cb4d1 --- /dev/null +++ b/frontend/src/views/TestView.vue @@ -0,0 +1,236 @@ + + +