ssw
|
7b95ae6d10
|
feat(dacli): v3.0+ webapi 镜像化 (app 命令族, regression audit P0)
新增 webapi 镜像模块 + app 命令 webapi 化 (详见 docs/cmd-review/regression-2026-06-29.md):
**新增 webapi 模块** (2 文件):
- src/webapi/auth.ts: 镜像 web/api/core/auth.ts (loginApi + logoutApi + saasLoginApi + getTenantMobileCode + applySaasApi)
- 6 个便捷包装函数 + AuthApi namespace 类型 + loadWebModule 真 import
- src/webapi/system.ts: 镜像 web/api/system/system.ts (15 函数)
- getSystemList / getAuthSystemList / create / update / getInfo / delSystem
- copySystem / exportSystem / getAppAuth / saveAppAuth / changeAppAuth / getDevUser
- getSystemSelector / getSystemlist / setPin
**重构 app 命令** (3 文件):
- app/list.ts: webapi/system.getSystemList (替代直接 c.get)
- app/info.ts: webapi/system.getInfo (替代直接 c.get)
- app/create.ts: webapi/system.getSystemList + create + saveAppAuth (step 1 + 4)
- step 2/3 保留 c.postJson (ssw-common 特有, web 无等价)
- step 5 保留 JnpfClient.login (有 encryptPassword 加密逻辑)
- 修复历史 TS 错误: installAiHelpHook.source 无 webapi 字段, 用 web 字段
- 修复历史 TS 错误: ClientOptions 无 checkSystem 字段, 用 any cast 透传
**应用隔离价值**:
- 之前缺失能力恢复: copySystem / exportSystem / saveAppAuth / changeAppAuth / setPin
- 与 web 端 schema 漂移风险消除 (复用 web 端类型 + query 参数处理 + 错误响应)
测试: TS 编译干净 + 3 项验证 PASS
- dacli app list 走 webapi 返回 11 个应用 ✓
- dacli app info 走 webapi 返回完整字段 ✓
- dacli apis list --tag=system 走 OR 匹配返回 364 API ✓
留给下个 turn: storage/org/report _validate.ts 补 formValidate + 校验项 (task 25)
|
2026-06-29 16:50:37 +08:00 |
|