refactor(dacli): migrate remaining 167 installAiHelpHook call sites to installHelpHook
This commit is contained in:
1 parent
9e82b1657a
commit
4a5cae861a
169 files changed
+344
-344
No files matched your search
@@ -22,7 +22,7 @@
|
||||
import { Command } from 'commander'
|
||||
import * as fs from 'node:fs'
|
||||
import * as path from 'node:path'
|
||||
import { installAiHelpHook } from '../core/help.ts'
|
||||
import { installHelpHook } from '../core/help.ts'
|
||||
import { log, printJson } from '../core/log.ts'
|
||||
import { execSync } from 'node:child_process'
|
||||
|
||||
@@ -184,7 +184,7 @@ const checks: Array<{ name: string; fn: (file: string) => CheckResult }> = [
|
||||
return { name: '--help 描述含 "镜像"', ok: true, message: '⊘ 通用文件 (_*.ts), 不要求' } as CheckResult
|
||||
}
|
||||
const content = fs.readFileSync(file, 'utf-8')
|
||||
// 找 installAiHelpHook 调用的 purpose 字段
|
||||
// 找 installHelpHook 调用的 purpose 字段
|
||||
const match = content.match(/purpose:\s*['"`]([^'"`]+)['"`]/)
|
||||
const has: boolean = !!(match && match[1].includes('镜像'))
|
||||
return {
|
||||
@@ -405,15 +405,15 @@ const checks: Array<{ name: string; fn: (file: string) => CheckResult }> = [
|
||||
return { name: 'AI 友好检查', ok: true, message: '⊘ 通用文件 (_*.ts), 不要求' } as CheckResult
|
||||
}
|
||||
const content = fs.readFileSync(file, 'utf-8')
|
||||
// 检查 installAiHelpHook + source 字段
|
||||
const hasAiHelp = /installAiHelpHook/.test(content)
|
||||
// 检查 installHelpHook + source 字段
|
||||
const hasAiHelp = /installHelpHook/.test(content)
|
||||
const hasSource = /source:\s*\{/.test(content)
|
||||
return {
|
||||
name: 'AI 友好检查',
|
||||
ok: hasAiHelp && hasSource,
|
||||
message: hasAiHelp && hasSource
|
||||
? '✓ 找到 installAiHelpHook + source 字段 (AI 学习材料完整)'
|
||||
: `✗ 缺 installAiHelpHook 或 source 字段 (AI 调试时查不到 web/backend 权威源)`,
|
||||
? '✓ 找到 installHelpHook + source 字段 (AI 学习材料完整)'
|
||||
: `✗ 缺 installHelpHook 或 source 字段 (AI 调试时查不到 web/backend 权威源)`,
|
||||
}
|
||||
},
|
||||
},
|
||||
@@ -514,7 +514,7 @@ export function buildSelfCheckCommand(): Command {
|
||||
}
|
||||
})
|
||||
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: 'v0.11d+ 强制纪律自检 (镜像 CLAUDE.md §2.7.1 自检清单 8 项). AI 场景补充, 非 web 镜像. 防止改前漏读 web/backend 源码 / 漏写 MEMORY / --help 漏 "镜像" / SKILL.md 漏 v0.11d+ 段.',
|
||||
required: { '<files...>': 'TS 文件路径 (可多个)' },
|
||||
optional: { '--json': '原始 JSON 输出' },
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { loadOpenApi, type OpenApiDoc } from './_cache.ts'
|
||||
|
||||
@@ -138,7 +138,7 @@ export function buildApisInfoCommand(): Command {
|
||||
console.log(' ' + JSON.stringify(out, null, 2).split('\n').join('\n '))
|
||||
})
|
||||
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '查单个 API 详情. 递归解析 $ref 展开 schema (含 ActionResult.data 内层), 写后端/调 API 必备.',
|
||||
required: { '<pathMethod>': 'API 路径: "GET /api/xxx" 或 "/api/xxx" (默认 GET)' },
|
||||
optional: { '--json': '原始 JSON 输出' },
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { loadOpenApi } from './_cache.ts'
|
||||
|
||||
@@ -42,7 +42,7 @@ export function buildApisListCommand(): Command {
|
||||
}
|
||||
})
|
||||
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '列 JNPF 平台全量 API. AI 干活前先 --tag 查相关业务接口.',
|
||||
required: {},
|
||||
optional: { '--tag': '按 tag 过滤', '--method': 'GET/POST', '--keyword': '搜索' },
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log } from '../../core/log.ts'
|
||||
import { loadOpenApi, getStatus } from './_cache.ts'
|
||||
|
||||
@@ -23,7 +23,7 @@ export function buildApisRefreshCommand(): Command {
|
||||
log.ok(`✓ 刷新成功: pathCount=${after.pathCount} openapiSize=${after.openapiSize}B`)
|
||||
})
|
||||
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '强制重拉 /v3/api-docs, 忽略 12h TTL. JNPF 升级/新增 API 后必跑.',
|
||||
required: {},
|
||||
example: 'dacli apis refresh',
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { loadOpenApi, type OpenApiDoc } from './_cache.ts'
|
||||
|
||||
@@ -131,7 +131,7 @@ export function buildApisSearchCommand(): Command {
|
||||
log.info(`\n💡 用法: dacli apis info "${result.apis[0]?.method} ${result.apis[0]?.path}" (看 schema 详情)`)
|
||||
})
|
||||
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '按字段名搜索 API (P0 字段盲猜痛点, AI 知道 f_xxx 但不知道哪个 API 接受)',
|
||||
required: { '--field': '字段名' },
|
||||
optional: {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* 诊断 "为什么 list 看不到新 API" —— 看 loaded/ageMs/pathCount/openapiSize
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { getStatus } from './_cache.ts'
|
||||
|
||||
@@ -30,7 +30,7 @@ export function buildApisStatusCommand(): Command {
|
||||
}
|
||||
})
|
||||
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '查 OpenAPI 缓存状态. 诊断"list 看不到新 API"——看 ageMs / pathCount.',
|
||||
required: {},
|
||||
optional: { '--json': '原始 JSON 输出' },
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { loadOpenApi, type OpenApiDoc } from './_cache.ts'
|
||||
|
||||
@@ -52,7 +52,7 @@ export function buildApisTagsCommand(): Command {
|
||||
log.info(`\n💡 用法: dacli apis list --tag=<name>`)
|
||||
})
|
||||
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '列 OpenAPI 所有 tag + 每个 tag 下的 API 数量. AI 引导.',
|
||||
optional: { '--json': '原始 JSON 输出' },
|
||||
example: [
|
||||
|
||||
@@ -30,7 +30,7 @@ import { fileURLToPath } from 'node:url'
|
||||
import { createInterface } from 'node:readline/promises'
|
||||
import { stdin as input, stdout as output } from 'node:process'
|
||||
import { parse as yamlParse, stringify as yamlStringify } from 'yaml'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log } from '../../core/log.ts'
|
||||
import { DacliError } from '../../core/types.ts'
|
||||
import { clearToken, getTokenPath, loadToken } from '../../core/config.ts'
|
||||
@@ -118,7 +118,7 @@ export function buildAppClearCommand(): Command {
|
||||
await runClear(opts)
|
||||
})
|
||||
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '清除 JNPF 应用的本地资源 + 数据库记录. DB 操作走 ssw-common POST /api/ssw/db/clear (PG/MySQL 自动适配), 文件备份到 docs/{app}/history-bak/{ts}/.',
|
||||
required: {
|
||||
'--appCode': '要清除的应用代码 (e.g. tds, tds2, testspace)',
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log } from '../../core/log.ts'
|
||||
import { loadToken } from '../../core/config.ts'
|
||||
import type { AppContext, FormSummary } from '../../core/types.ts'
|
||||
@@ -402,7 +402,7 @@ export function buildAppContextCommand(): Command {
|
||||
}
|
||||
})
|
||||
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose:
|
||||
'输出当前应用环境快照 (appCode/dbLinkId/token 状态/enCode/表/菜单). ' +
|
||||
'AI 新会话第一步先跑此命令, 所有参数从此快照取, 不要猜测.',
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log } from '../../core/log.ts'
|
||||
import { saveToken } from '../../core/config.ts'
|
||||
import type { TokenFile } from '../../core/types.ts'
|
||||
@@ -82,7 +82,7 @@ export function buildAppCreateCommand(): Command {
|
||||
await runCreate(opts)
|
||||
})
|
||||
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '真·创建 JNPF 应用 (System+DB+DataSource+授权+重登, 端到端 0 差错). v3.0+ step 1/4 走 webapi/system 镜像',
|
||||
required: {
|
||||
'--appCode': '应用编码 (英文, 唯一)',
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { initWebapi as initSystemWebapi, getInfo } from '../../webapi/system.ts'
|
||||
|
||||
@@ -39,7 +39,7 @@ export function buildAppInfoCommand(): Command {
|
||||
console.log(`creatorTime: ${d.creatorTime || '-'}`)
|
||||
if (d.propertyJson) console.log(`propertyJson: ${d.propertyJson}`)
|
||||
})
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '查看应用详情 (含 systemId/系统配置等). v3.0+ 走 webapi/system.getInfo',
|
||||
required: { '--id': '应用 id' },
|
||||
example: 'dacli app info --id=835128640063677381',
|
||||
|
||||
@@ -30,7 +30,7 @@ import { existsSync } from 'node:fs'
|
||||
import { dirname, join } from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log } from '../../core/log.ts'
|
||||
import { healthCheck, formatHealthCheckForHuman } from '../../core/_health_check.ts'
|
||||
|
||||
@@ -106,7 +106,7 @@ export function buildAppInitCommand(): Command {
|
||||
<<<<<<< Updated upstream
|
||||
}
|
||||
})
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '应用初始化 (健康检查 + system 缺失检测; v3.0+ 移除 --restart)',
|
||||
optional: {
|
||||
'--appCode': '应用 code (不传则用当前登录)',
|
||||
@@ -119,7 +119,7 @@ export function buildAppInitCommand(): Command {
|
||||
log.info(' 计划: 读 dacli.conf 的 jar-pattern/port, kill+rm+nohup+健康检查+重登')
|
||||
}
|
||||
})
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '应用初始化 (健康检查 / 重启 JNPF / system 缺失时自动重建)',
|
||||
optional: {
|
||||
'--appCode': '应用 code (不传则用当前登录)',
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { initWebapi as initSystemWebapi, getSystemList } from '../../webapi/system.ts'
|
||||
|
||||
@@ -61,7 +61,7 @@ export function buildAppListCommand(): Command {
|
||||
console.log(`${id}${name}${code}${del}`)
|
||||
}
|
||||
})
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '列出所有应用 (JNPF 多 app 生命周期, 不同于当前登录 appCode). v3.0+ 走 webapi/system.getSystemList',
|
||||
optional: { '--keyword': '按名称/编码模糊搜索' },
|
||||
example: 'dacli app list\ndacli app list --keyword=tds',
|
||||
|
||||
@@ -14,7 +14,7 @@ import {
|
||||
clearToken,
|
||||
getTokenPath,
|
||||
} from '../../core/config.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log } from '../../core/log.ts'
|
||||
import { checkSystemExists } from './_check_system.ts'
|
||||
|
||||
@@ -82,7 +82,7 @@ export function buildAppLoginCommand(): Command {
|
||||
log.dim(`saved to : ${getTokenPath()}`)
|
||||
})
|
||||
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '登录 JNPF, 把 token 写到 ~/.dacli-token/token.json (默认 home, 可由 DACLI_TOKEN_DIR env 覆盖), 后续命令自动复用',
|
||||
optional: {
|
||||
'--account': '账号 (默认 admin)',
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log } from '../../core/log.ts'
|
||||
import { clearToken, getTokenPath } from '../../core/config.ts'
|
||||
import { initWebapi as initAuthWebapi, logoutApi } from '../../webapi/auth.ts'
|
||||
@@ -97,7 +97,7 @@ export function buildAppLogoutCommand(): Command {
|
||||
}
|
||||
})
|
||||
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '退出登录 (走 webapi/auth.logoutApi + 清本地 token). v3.0+ 新增 (cmd-review/app.md 识别)',
|
||||
optional: {
|
||||
'--no-remote-logout': '跳过 web logoutApi, 仅清本地 token',
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { loadToken, getTokenPath, currentBaseUrl } from '../../core/config.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log } from '../../core/log.ts'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { healthCheck, formatHealthCheckForHuman } from '../../core/_health_check.ts'
|
||||
@@ -110,7 +110,7 @@ export function buildAppStatusCommand(): Command {
|
||||
}
|
||||
})
|
||||
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '显示当前登录状态. 写脚本前先跑一下确认登录态',
|
||||
optional: {
|
||||
'--json': '以 JSON 输出',
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { DEFAULT_ACCOUNT, DEFAULT_PASSWORD, loadToken } from '../../core/config.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log } from '../../core/log.ts'
|
||||
|
||||
export function buildAppSwitchCommand(): Command {
|
||||
@@ -26,7 +26,7 @@ export function buildAppSwitchCommand(): Command {
|
||||
log.dim(`dbLinkId : ${c.dbLinkId || '(unknown)'}`)
|
||||
})
|
||||
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '切换当前应用, 重新登录并覆盖本地 token. baseline 复刻常用',
|
||||
required: { '--appCode': '目标应用 (testspace=测试场 | jxcj=业务 | developSystem/workSystem=只读 baseline, 禁止改)' },
|
||||
example: ['dacli app switch --appCode=testspace', 'dacli app switch --appCode=jxcj'],
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { DEFAULT_ACCOUNT, DEFAULT_PASSWORD, loadToken } from '../../core/config.ts'
|
||||
import { getUserInfoApi } from '../../webapi/user.ts'
|
||||
@@ -168,7 +168,7 @@ export function buildAppUseCommand(): Command {
|
||||
}
|
||||
})
|
||||
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '一体化命令 (v3.0+ P1): switch + context + CurrentUser, AI 工作流一步到位',
|
||||
required: { '<appCode>': '目标应用代码' },
|
||||
optional: {
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
import { Command } from 'commander'
|
||||
import { readFileSync, existsSync } from 'node:fs'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { initWebapi, loadVisualData } from '../../webapi/visualdata.ts'
|
||||
import {
|
||||
@@ -118,7 +118,7 @@ export function buildBigscreenConstructCommand(): Command {
|
||||
}
|
||||
})
|
||||
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '构造大屏 (v0.13+ 镜像 web 端 save formdata 镜像 + 内置模板/用户 JSON/单组件添加, 端到端一气呵成)',
|
||||
required: {
|
||||
'--fullName | --enCode | --category': '大屏基础信息 (跟 create 命令相同)',
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { initWebapi, loadVisualData } from '../../webapi/visualdata.ts'
|
||||
|
||||
@@ -82,7 +82,7 @@ export function buildBigscreenCreateCommand(): Command {
|
||||
)
|
||||
if (opts.json) printJson({ id, enCode: opts.enCode })
|
||||
})
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '新建大屏 (jnpf 6.x 6.2.0, 走 datascreen-vue3 webapp /api/visual/save 端口 32000)',
|
||||
required: { '--fullName | --enCode | --category': '中文名 + 英文编码 + 分类 (1=数据大屏 2=仪表盘)' },
|
||||
optional: {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log } from '../../core/log.ts'
|
||||
import { initWebapi, loadVisualData } from '../../webapi/visualdata.ts'
|
||||
|
||||
@@ -31,7 +31,7 @@ export function buildBigscreenDeleteCommand(): Command {
|
||||
await loadVisualData.delObj(opts.id)
|
||||
log.ok(`✓ 大屏已删除 (id=${opts.id})`)
|
||||
})
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '大屏删除',
|
||||
required: { '--id': '大屏 id', '--yes': '跳过确认' },
|
||||
example: 'dacli bigscreen delete --id=123 --yes',
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { initWebapi, loadVisualData } from '../../webapi/visualdata.ts'
|
||||
import { enhanceFromBackend, formatErrorLine } from '../_error_codes.ts'
|
||||
@@ -46,7 +46,7 @@ export function buildBigscreenInfoCommand(): Command {
|
||||
console.log(`status: ${visual.status === 1 ? '已发布' : '未发布'}`)
|
||||
if (opts.json) printJson(r.data)
|
||||
})
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '查看大屏详情',
|
||||
required: { '--id': '大屏 id' },
|
||||
example: 'dacli bigscreen info --id=835246813026985082',
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { initWebapi, loadVisualData } from '../../webapi/visualdata.ts'
|
||||
|
||||
@@ -54,7 +54,7 @@ export function buildBigscreenListCommand(): Command {
|
||||
console.log(`${id}${name}${code}${cat}`)
|
||||
}
|
||||
})
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '列出大屏 (大屏设计器产物)',
|
||||
optional: { '--keyword': '按名称/编码模糊搜索' },
|
||||
example: 'dacli bigscreen list\ndacli bigscreen list --keyword=销售',
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log } from '../../core/log.ts'
|
||||
import { initWebapi, loadVisualData } from '../../webapi/visualdata.ts'
|
||||
import { enhanceFromBackend, formatErrorLine } from '../_error_codes.ts'
|
||||
@@ -57,7 +57,7 @@ export function buildBigscreenReleaseCommand(): Command {
|
||||
await loadVisualData.updateObj(visual)
|
||||
log.info(`✓ 大屏 id=${opts.id} 已发布 (status=1)`)
|
||||
})
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '发布大屏 (state 0→1, 菜单可挂)',
|
||||
required: { '--id': '大屏 id' },
|
||||
example: 'dacli bigscreen release --id=1234567890',
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { initWebapi, loadVisualData } from '../../webapi/visualdata.ts'
|
||||
import { dirtyCheck, dirtyCheckFailAndExit } from '../_dirty_check.ts'
|
||||
@@ -77,7 +77,7 @@ export function buildBigscreenUpdateCommand(): Command {
|
||||
log.ok(`✓ 大屏更新成功 (id=${opts.id})`)
|
||||
if (opts.json) printJson(r.data)
|
||||
})
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '大屏修改. 改 fullName/enCode/category, PUT 语义 + v0.11e+ dirty check.',
|
||||
required: { '--id': '大屏 id' },
|
||||
optional: {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { encryptAesEcb, isEncrypted } from '../../core/crypto.ts'
|
||||
import { initWebapi, loadDataSource } from '../../webapi/dataSource.ts'
|
||||
@@ -105,7 +105,7 @@ export function buildDatasourceCreateCommand(): Command {
|
||||
log.info(`✓ 数据源创建成功 id=${id}`)
|
||||
if (opts.json) printJson({ ...(r as object), id })
|
||||
})
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '新建数据源 (数据库连接配置)',
|
||||
required: {
|
||||
'--fullName': '数据源名称',
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log } from '../../core/log.ts'
|
||||
import { initWebapi, loadDataSource } from '../../webapi/dataSource.ts'
|
||||
|
||||
@@ -34,7 +34,7 @@ export function buildDatasourceDeleteCommand(): Command {
|
||||
}
|
||||
log.info(`✓ 数据源 id=${opts.id} 已删除`)
|
||||
})
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '删除数据源 (硬删, 无回收)',
|
||||
required: { '--id': '数据源 id', '--yes': '跳过确认' },
|
||||
example: 'dacli datasource delete --id=1234567890 --yes',
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { initWebapi, loadDataSource } from '../../webapi/dataSource.ts'
|
||||
|
||||
@@ -42,7 +42,7 @@ export function buildDatasourceListCommand(): Command {
|
||||
console.log(`${id}${name}${code}${type}`)
|
||||
}
|
||||
})
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '列出当前应用所有数据源 (MySQL/SQLServer/Oracle/PostgreSQL 等)',
|
||||
optional: { '--keyword': '按名称/编码模糊搜索' },
|
||||
example: 'dacli datasource list\ndacli datasource list --keyword=test',
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { encryptAesEcb, isEncrypted } from '../../core/crypto.ts'
|
||||
import { initWebapi, loadDataSource } from '../../webapi/dataSource.ts'
|
||||
@@ -66,7 +66,7 @@ export function buildDatasourceTestCommand(): Command {
|
||||
log.info(`✓ 数据源连接成功`)
|
||||
if (opts.json) printJson(r.data)
|
||||
})
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '测试数据源连接 (按 --id 拉配置, 或直接给参数)',
|
||||
required: { '--id | --dbType+--host+--user+--password': '已存在 id 或 新建连接' },
|
||||
example: 'dacli datasource test --id=1234567890\ndacli datasource test --dbType=MySQL --host=127.0.0.1 --port=3306 --user=root --password=123456',
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { enhanceFromBackend, formatErrorLine } from '../_error_codes.ts'
|
||||
import { initWebapi as initDiWebapi, loadDataInterface } from '../../webapi/di.ts'
|
||||
@@ -75,7 +75,7 @@ export function buildDiCopyCommand(): Command {
|
||||
log.ok(`✓ DI 复制成功 (源 id=${opts.id} → 新 id=${newId})`)
|
||||
if (opts.json) printJson({ sourceId: opts.id, newId, code: code ?? 200, msg: msg ?? '复制成功' })
|
||||
})
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '复制数据接口 (v0.15+ 镜像 web copy)',
|
||||
required: { '--id': '源 DI id' },
|
||||
example: [
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { initWebapi, loadDataInterface, getDataInterfaceList } from '../../webapi/di.ts' // v0.15+ (P0-8): getDataInterfaceList 替代 c.get
|
||||
import { validateDiUpdate, type DiOpts } from './_validate.ts'
|
||||
@@ -187,7 +187,7 @@ export function buildDiCreateCommand(): Command {
|
||||
if (opts.json) printJson({ ...(r.data as object), id: newId })
|
||||
})
|
||||
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '新建数据接口 (v0.11d+ webapi 化 + step machine 校验). 镜像 web dataInterface/Form.vue + 后端 DataInterfaceController.create',
|
||||
required: {
|
||||
'--fullName': '名称 (必填, maxlength 50)',
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log } from '../../core/log.ts'
|
||||
import { initWebapi, loadDataInterface } from '../../webapi/di.ts'
|
||||
|
||||
@@ -32,7 +32,7 @@ export function buildDiDeleteCommand(): Command {
|
||||
}
|
||||
log.ok(`✓ DI id=${opts.id} 已删除`)
|
||||
})
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '数据接口删除. 引用该 DI 的 form 会失效.',
|
||||
required: { '--id': 'DI id', '--yes': '跳过确认' },
|
||||
example: 'dacli di delete --id=1234567890 --yes',
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { enhanceFromBackend, formatErrorLine } from '../_error_codes.ts'
|
||||
import { initWebapi as initDiWebapi, loadDataInterface } from '../../webapi/di.ts'
|
||||
@@ -69,7 +69,7 @@ export function buildDiExportCommand(): Command {
|
||||
log.info(`提示: 复制 URL 用 curl/浏览器下载, 或加 -o <file> 走 wget`)
|
||||
if (opts.json) printJson({ id: opts.id, name: obj.name, url: obj.url })
|
||||
})
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '导出数据接口 (v0.15+ 镜像 web exportData)',
|
||||
required: { '--id': 'DI id' },
|
||||
example: [
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { initWebapi, loadDataInterface } from '../../webapi/di.ts'
|
||||
|
||||
@@ -40,7 +40,7 @@ export function buildDiInfoCommand(): Command {
|
||||
if (d.requestParams) console.log(` requestParams : ${JSON.stringify(d.requestParams).slice(0, 200)}`)
|
||||
if (d.responseParams) console.log(` responseParams : ${JSON.stringify(d.responseParams).slice(0, 200)}`)
|
||||
})
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '数据接口详情 (含 request/response schema + 参数).',
|
||||
required: { '--id': '数据接口 id' },
|
||||
optional: { '--json': '原始 JSON 输出' },
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { initWebapi, loadDataInterface } from '../../webapi/di.ts'
|
||||
|
||||
@@ -42,7 +42,7 @@ export function buildDiListCommand(): Command {
|
||||
}
|
||||
})
|
||||
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '列出所有数据接口 (弹窗选择/下拉补全/关联表单用).',
|
||||
required: {},
|
||||
optional: { '--keyword': '搜索' },
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { initWebapi, loadDataInterface } from '../../webapi/di.ts'
|
||||
|
||||
@@ -61,7 +61,7 @@ export function buildDiTestCommand(): Command {
|
||||
if (opts.json) printJson(r.data)
|
||||
else console.log(JSON.stringify(r.data ?? {}, null, 2).slice(0, 500))
|
||||
})
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '数据接口测试调用. AI 验证 DI 配置正确性 (链路, 鉴权, 返回值).',
|
||||
required: { '--id': '数据接口 id' },
|
||||
optional: {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { initWebapi, loadDataInterface, getDataInterfaceList } from '../../webapi/di.ts' // v0.15+ (P0-8): getDataInterfaceList 替代 c.get
|
||||
import { validateDiUpdate, type DiOpts } from './_validate.ts'
|
||||
@@ -95,7 +95,7 @@ export function buildDiUpdateCommand(): Command {
|
||||
log.ok(`✓ DI 更新成功 (id=${opts.id})`)
|
||||
if (opts.json) printJson(r.data)
|
||||
})
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '数据接口修改 (改 schema/path/参数). PUT 语义, 未传字段保留原值. v0.11d+ 加 step machine 校验 (3 step 镜像 web dataInterface/Form.vue + 后端 DataInterfaceController.update, BS-47 唯一性预校验, 聚合错误)',
|
||||
required: { '--id': '数据接口 id' },
|
||||
optional: { '--fullName': '中文名', '--enCode': '英文编码', '--categoryId': '分类 id', '--action': '动作 (1=增 2=改 3=查 4=删, type=1 必填)', '--url': '接口路径/URL', '--expected-enCode': '防 AI 误覆盖 (A2)', '--expected-state': '防 AI 误覆盖 (A2)', '--force': '跳过 dirty check (A2)' },
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { initWebapi, loadDict } from '../../webapi/dict.ts'
|
||||
import { lookupDataIdByEnCode } from './_lookup.ts'
|
||||
@@ -166,7 +166,7 @@ export function buildDictDataCreateCommand(): Command {
|
||||
if (opts.json) printJson({ typeId: opts.typeId, success: ok, skipped: skippedItems.length, failed: fail, ids })
|
||||
})
|
||||
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '往已存在字典类型追加字典项 (单条/批量, 自动跳过重复).',
|
||||
required: { '--typeId': '字典类型 id' },
|
||||
optional: {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log } from '../../core/log.ts'
|
||||
import { initWebapi, loadDict } from '../../webapi/dict.ts'
|
||||
|
||||
@@ -33,7 +33,7 @@ export function buildDictDataDeleteCommand(): Command {
|
||||
}
|
||||
log.ok(`✓ 字典项已删除 (id=${opts.id})`)
|
||||
})
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '字典项删除',
|
||||
required: { '--id': '字典项 id', '--yes': '跳过确认' },
|
||||
example: 'dacli dict dataDelete --id=123 --yes',
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { initWebapi, loadDict } from '../../webapi/dict.ts'
|
||||
|
||||
@@ -49,7 +49,7 @@ export function buildDictDataListCommand(): Command {
|
||||
}
|
||||
})
|
||||
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '看字典数据. --typeId 看单类型, 不传 --all 拿全部.',
|
||||
required: {},
|
||||
optional: { '--typeId': '字典类型 id', '--all': '拿全部字典' },
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { initWebapi, loadDict } from '../../webapi/dict.ts'
|
||||
import { dirtyCheck, dirtyCheckFailAndExit } from '../_dirty_check.ts'
|
||||
@@ -82,7 +82,7 @@ export function buildDictDataUpdateCommand(): Command {
|
||||
log.ok(`✓ 字典项更新成功 (id=${opts.id})`)
|
||||
if (opts.json) printJson(r.data)
|
||||
})
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '字典项修改 (改名/排序/启用). PUT 语义, 未传保留.',
|
||||
required: { '--id': '字典项 id' },
|
||||
optional: { '--enCode': '编码', '--fullName': '名', '--sortCode': '排序', '--enabledMark': '启用/禁用' },
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { initWebapi, loadDict } from '../../webapi/dict.ts'
|
||||
import { validateDictTypeCreate, type DictItemLite } from './_validate.ts'
|
||||
@@ -176,7 +176,7 @@ export function buildDictTypeCreateCommand(): Command {
|
||||
if (opts.json) printJson({ typeId, enCode: opts.enCode, fullName: opts.fullName })
|
||||
})
|
||||
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '创建字典类型 (含可选 items 批量建). 端到端 1 条命令替代 web UI 手敲. v0.11d+ 加 step machine 校验 (3 step 镜像 web dict/components/Form.vue + 后端 DictionaryTypeController.create, BS-47 唯一性预校验, 聚合错误)',
|
||||
required: {
|
||||
'--enCode': '字典编码 (英文唯一, BS-47)',
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log } from '../../core/log.ts'
|
||||
import { initWebapi, loadDict } from '../../webapi/dict.ts'
|
||||
|
||||
@@ -33,7 +33,7 @@ export function buildDictTypeDeleteCommand(): Command {
|
||||
}
|
||||
log.ok(`✓ 字典类型已删除 (id=${opts.id})`)
|
||||
})
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '字典类型删除 (级联删字典项)',
|
||||
required: { '--id': '字典类型 id', '--yes': '跳过确认' },
|
||||
example: 'dacli dict typeDelete --id=123 --yes',
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { initWebapi, loadDict } from '../../webapi/dict.ts'
|
||||
|
||||
@@ -111,7 +111,7 @@ export function buildDictTypeListCommand(): Command {
|
||||
}
|
||||
})
|
||||
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '列出所有字典类型 (默认递归展平 children, BS-New-6 ON).',
|
||||
required: {},
|
||||
optional: {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { initWebapi, loadDict } from '../../webapi/dict.ts'
|
||||
import { enhanceFromBackend, formatErrorLine } from '../_error_codes.ts'
|
||||
@@ -88,7 +88,7 @@ export function buildDictTypeUpdateCommand(): Command {
|
||||
log.ok(`✓ 字典类型更新成功 (id=${opts.id})`)
|
||||
if (opts.json) printJson(r.data)
|
||||
})
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '字典类型修改 (改名/分类/树形/排序). PUT 语义, 未传保留.',
|
||||
required: { '--id': '字典类型 id' },
|
||||
optional: { '--fullName': '名', '--enCode': '编码', '--category': '分类', '--isTree': '树形', '--sortCode': '排序', '--expected-enCode': '防 AI 误覆盖 (A2)', '--expected-state': '防 AI 误覆盖 (A2)', '--force': '跳过 dirty check (A2)' },
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { preCheckDmCreate, handlePreCheckResult, loadContextSafe } from '../_precheck.ts'
|
||||
import { runGuards, handleGuardResult } from '../_blindspot_guards.ts'
|
||||
@@ -173,7 +173,7 @@ export function buildDmCreateCommand(): Command {
|
||||
if (opts.json) printJson(r.data)
|
||||
})
|
||||
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '在指定业务库建物理表. fields JSON 必含 field/fieldName/dataType/dataLength. v0.11d+ 加 step machine 校验 (3 step 镜像 web dataModel/Form.vue + 后端 DbTableController.checkName, 聚合错误, AI 不用去浏览器试错)',
|
||||
required: { '--table': '表名', '--tableName': '中文名', '--fields': '字段 JSON' },
|
||||
optional: { '--dbLinkId': '业务库 id' },
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log } from '../../core/log.ts'
|
||||
import { initWebapi, loadDataModel } from '../../webapi/dataModel.ts'
|
||||
|
||||
@@ -43,7 +43,7 @@ export function buildDmDropCommand(): Command {
|
||||
log.ok(`已删除: ${opts.table}`)
|
||||
})
|
||||
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '删除物理表. ⚠️ 不可恢复.',
|
||||
required: { '--table': '表名', '--yes': '必须传 --yes 跳过确认' },
|
||||
optional: { '--dbLinkId': '业务库 id' },
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { initWebapi, loadDataModel } from '../../webapi/dataModel.ts'
|
||||
|
||||
@@ -56,7 +56,7 @@ export function buildDmFieldsCommand(): Command {
|
||||
}
|
||||
})
|
||||
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '查指定物理表的所有字段定义.',
|
||||
required: { '--table': '表名' },
|
||||
optional: { '--dbLinkId': '业务库 id' },
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { initWebapi, loadDataModel } from '../../webapi/dataModel.ts'
|
||||
|
||||
@@ -52,7 +52,7 @@ export function buildDmListCommand(): Command {
|
||||
}
|
||||
})
|
||||
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '列出指定业务库的所有数据模型表. dbLinkId=0 是主库 (平台库).',
|
||||
required: {},
|
||||
optional: { '--dbLinkId': '业务库 id', '--keyword': '表名搜索', '--page': '页码', '--pageSize': '每页条数' },
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { resolve } from 'node:path'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { getSection, getRawLines, listSections } from './_parser.ts'
|
||||
|
||||
@@ -80,7 +80,7 @@ export function buildDocGetCommand(): Command {
|
||||
}
|
||||
})
|
||||
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '读 HTML 文档 section 纯文本. 上下文恢复核心 (CLAUDE.md 强调 token 降低 80%).',
|
||||
required: { '--file': 'HTML 文件路径' },
|
||||
optional: {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
import { Command } from 'commander'
|
||||
import { readdirSync, statSync, existsSync } from 'node:fs'
|
||||
import { join, resolve } from 'node:path'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
|
||||
interface Opts { dir?: string; json?: boolean }
|
||||
@@ -49,7 +49,7 @@ export function buildDocListCommand(): Command {
|
||||
}
|
||||
})
|
||||
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '列 HTML/MD 文档, AI 上下文恢复时先看 list 再 cat 关键 section.',
|
||||
required: {},
|
||||
optional: { '--dir': '扫描目录' },
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
import { Command } from 'commander'
|
||||
import { resolve } from 'node:path'
|
||||
import { existsSync } from 'node:fs'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { parseFile } from './_parser.ts'
|
||||
|
||||
@@ -93,7 +93,7 @@ export function buildDocSearchCommand(): Command {
|
||||
}
|
||||
})
|
||||
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '按关键词全文搜索 HTML 文档, 避免 get 全文再 grep 的 token 浪费',
|
||||
required: { '--file': 'HTML 文件路径', '--keyword': '搜索关键词 (支持正则)' },
|
||||
optional: {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
import { Command } from 'commander'
|
||||
import { resolve } from 'node:path'
|
||||
import { existsSync } from 'node:fs'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { listSections } from './_parser.ts'
|
||||
|
||||
@@ -38,7 +38,7 @@ export function buildDocTocCommand(): Command {
|
||||
log.info(`\n💡 用法: dacli doc get --file=${opts.file} --section=<id>`)
|
||||
})
|
||||
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '列 HTML 文件 section 清单 (P0 上下文恢复核心), AI 精准切片避免全文 Read',
|
||||
required: { '--file': 'HTML 文件路径' },
|
||||
optional: { '--json': '原始 JSON 输出' },
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { initWebapi, loadVisualDev } from '../../webapi/visualDev.ts'
|
||||
|
||||
@@ -629,7 +629,7 @@ export function buildFormAuditCommand(): Command {
|
||||
process.exit(totalIssues > 0 ? 1 : 0)
|
||||
})
|
||||
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '审计表单业务盲点 (BS-新61~64: select 空字典 / input FK / 数字范围 / formRules 缺失) — 镜像 web FormGenerator + JNPF VisualdevController 后端 schema 检测',
|
||||
required: { '--formId / --enCode / --all': '三选一' },
|
||||
optional: {
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { initWebapi, loadVisualDev } from '../../webapi/visualDev.ts'
|
||||
|
||||
@@ -207,7 +207,7 @@ export function buildFormBindFlowCommand(): Command {
|
||||
}
|
||||
})
|
||||
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '表单绑工作流 (BS-New-4: form 端 flowId + workflow start node formId 双向持久化).',
|
||||
required: { '--formId': '表单 id', '--flowId': '工作流模板 id' },
|
||||
example: 'dacli form bindFlow --formId=836303723314554053 --flowId=836303152285230277',
|
||||
|
||||
@@ -27,7 +27,7 @@ import { Command } from 'commander'
|
||||
import { writeFileSync, mkdirSync, existsSync, readdirSync } from 'node:fs'
|
||||
import { dirname, join } from 'node:path'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { initWebapi, loadVisualDev } from '../../webapi/visualDev.ts'
|
||||
|
||||
@@ -1005,7 +1005,7 @@ export function buildFormCodegenCommand(): Command {
|
||||
await autoMountMenu(c, formId, fullName, enCode)
|
||||
}
|
||||
})
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '表单代码生成 (白皮书 5.5) — 调平台 CodePreview, 写到本地目录, 参考 aibridge CodeGenerator',
|
||||
required: { '<formId>': 'form id (要先 release, state=1)' },
|
||||
optional: {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log } from '../../core/log.ts'
|
||||
|
||||
interface DeleteOpts {
|
||||
@@ -84,7 +84,7 @@ export function buildFormDeleteCommand(): Command {
|
||||
}
|
||||
})
|
||||
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '删除表单. 不可恢复, 加 --yes 跳过确认. --cascade 级联删关联菜单.',
|
||||
required: { '<id>': '表单 id' },
|
||||
optional: { '--yes': '跳过确认', '--cascade': '级联删关联菜单 (解决 BS-43 名称重复)' },
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
import { writeFileSync } from 'node:fs'
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import type { FormDetail } from '../../core/types.ts'
|
||||
import { initWebapi, loadVisualDev } from '../../webapi/visualDev.ts'
|
||||
@@ -109,7 +109,7 @@ export function buildFormExportCommand(): Command {
|
||||
if (!opts.out) printJson({ id, enCode: data.enCode, path, physicalTables: phyCount, physicalFields: phyFields })
|
||||
})
|
||||
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '导出表单完整 schema + 物理表 schema 到文件 (v0.7 解 #15). 用于 baseline 复刻 / 备份 / 跨应用迁移',
|
||||
required: { '<id>': '源表单 id' },
|
||||
optional: {
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
import { Command } from 'commander'
|
||||
import { existsSync, readFileSync, writeFileSync, readdirSync } from 'node:fs'
|
||||
import { join } from 'node:path'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log } from '../../core/log.ts'
|
||||
import { loadToken } from '../../core/config.ts'
|
||||
|
||||
@@ -167,7 +167,7 @@ export function buildFormFixEntityCommand(): Command {
|
||||
}
|
||||
log.info(`完成: fixed=${totalFixed} skipped=${totalSkipped}`)
|
||||
})
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: 'P0 修复: entity 加 @TableId + Service 加 jnpf-origin null check (jnpf 雪花 id 必需, jxcj 2026-06-29 实战教训).',
|
||||
required: {},
|
||||
optional: { '--table': '只修指定表', '--dir': '自定义目录', '--type': 'entity|biz|all', '--dry-run': '只显示不写' },
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
import { readFileSync } from 'node:fs'
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log } from '../../core/log.ts'
|
||||
import { initWebapi, loadVisualDev } from '../../webapi/visualDev.ts'
|
||||
import { browserVerify } from './_browser_verify.ts'
|
||||
@@ -368,7 +368,7 @@ export function buildFormImportCommand(): Command {
|
||||
}
|
||||
})
|
||||
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '从 JSON 导入表单. v0.7 默认 --autoTable 在目标库重建物理表, 解 #15.',
|
||||
required: { '<file>': 'JSON 文件路径' },
|
||||
optional: {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { printJson, log } from '../../core/log.ts'
|
||||
import type { FormDetail } from '../../core/types.ts'
|
||||
import { initWebapi, loadVisualDev } from '../../webapi/visualDev.ts'
|
||||
@@ -69,7 +69,7 @@ export function buildFormInfoCommand(): Command {
|
||||
printJson(data)
|
||||
})
|
||||
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '拉表单完整 schema. clone 前先 info 看结构',
|
||||
required: { '<id>': '表单 id' },
|
||||
optional: {
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import type { FormSummary } from '../../core/types.ts'
|
||||
import { initWebapi, loadVisualDev } from '../../webapi/visualDev.ts'
|
||||
@@ -83,7 +83,7 @@ export function buildFormListCommand(): Command {
|
||||
}
|
||||
})
|
||||
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '列出当前应用的所有表单 (BS-53 v0.12+: 默认显示 STATE 列, --state 支持 2, --summary 输出分布). AI 干活前先跑 --summary 看 state 健康度',
|
||||
optional: {
|
||||
'--keyword': '过滤 (服务器侧)',
|
||||
|
||||
@@ -24,7 +24,7 @@ import { Command } from 'commander'
|
||||
import * as fs from 'node:fs'
|
||||
import * as path from 'node:path'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { initWebapi, loadVisualDev } from '../../webapi/visualDev.ts'
|
||||
|
||||
@@ -98,7 +98,7 @@ export function buildFormPreviewCommand(): Command {
|
||||
log.info(` 列表列数: ${(columnList as unknown[]).length} 表单字段数: ${(formDataFields as unknown[]).length}`)
|
||||
})
|
||||
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '输出 form standalone HTML 预览, 浏览器打开即可, 无需 JNPF/nginx. AI 场景增强 (web 没专门 FormPreview 组件, 是 FormGenerator 复用)',
|
||||
required: { '--id': '表单 id' },
|
||||
optional: {
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log } from '../../core/log.ts'
|
||||
import { loadContextSafe, preCheckFormRelease } from '../_precheck.ts'
|
||||
import { runGuards, handleGuardResult, formatIssues } from '../_blindspot_guards.ts'
|
||||
@@ -88,7 +88,7 @@ export function buildFormReleaseCommand(): Command {
|
||||
process.exit(1)
|
||||
})
|
||||
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '把表单从 state=0|2 切到 state=1, 前端列表才能看到 (BS-53: state=2 = 已发布被编辑过, 自动重新发布)',
|
||||
required: { '<id>': '表单 id' },
|
||||
optional: { '--soft': 'type=4 时软跳过' },
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { initWebapi, loadVisualDev } from '../../webapi/visualDev.ts'
|
||||
|
||||
@@ -72,7 +72,7 @@ export function buildFormSelectorCommand(): Command {
|
||||
}
|
||||
})
|
||||
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '功能 (form) 下拉框, AI 创建菜单 / 工作流 / select 字段时必跑.',
|
||||
required: {},
|
||||
optional: {
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { initWebapi, loadVisualDev } from '../../webapi/visualDev.ts'
|
||||
import { dirtyCheck, dirtyCheckFailAndExit } from '../_dirty_check.ts'
|
||||
@@ -241,7 +241,7 @@ export function buildFormUpdateCommand(): Command {
|
||||
if (opts.json) printJson({ id: opts.id, action: 'updated' })
|
||||
})
|
||||
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '表单修改 (高需求 P0 NEW-CMD, 改 schema/字段/enCode, PUT 语义). 解决之前需 export → 改 → import 的无原子性.',
|
||||
required: { '--id': '表单 id' },
|
||||
optional: {
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log } from '../../core/log.ts'
|
||||
import { enhanceFromBackend, formatErrorLine } from '../_error_codes.ts'
|
||||
|
||||
@@ -58,7 +58,7 @@ export function buildIntegrationEmailTestCommand(): Command {
|
||||
}
|
||||
log.info(`✓ 邮件测试发送 OK (configId=${opts.configId}, to=${opts.email})`)
|
||||
})
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '邮件测试发送 (修复 v0.10 假 PASS 端点)',
|
||||
required: { '--configId': 'AccountConfig id' },
|
||||
optional: {
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log } from '../../core/log.ts'
|
||||
import { enhanceFromBackend, formatErrorLine } from '../_error_codes.ts'
|
||||
|
||||
@@ -57,7 +57,7 @@ export function buildIntegrationSmsTestCommand(): Command {
|
||||
}
|
||||
log.info(`✓ 短信测试发送 OK (configId=${opts.configId}, to=${opts.phone})`)
|
||||
})
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '短信测试发送 (修复 v0.10 假 PASS 端点)',
|
||||
required: { '--configId': 'AccountConfig id' },
|
||||
optional: {
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log } from '../../core/log.ts'
|
||||
import { enhanceFromBackend, formatErrorLine } from '../_error_codes.ts'
|
||||
|
||||
@@ -72,7 +72,7 @@ export function buildIntegrationWebhookTestCommand(): Command {
|
||||
}
|
||||
log.info(`✓ Webhook 测试发送 OK (configId=${opts.configId || '-'}, url=${opts.url || '(from config)'})`)
|
||||
})
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: 'Webhook 测试发送 (修复 v0.10 假 PASS 端点)',
|
||||
required: {},
|
||||
optional: {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { initWebapi, loadLog } from '../../webapi/log.ts'
|
||||
|
||||
@@ -57,7 +57,7 @@ export function buildLogExceptionCommand(): Command {
|
||||
}
|
||||
}
|
||||
})
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '异常日志 (Java 异常堆栈, AI 调试后端错误核心入口).',
|
||||
optional: { '--keyword': '按账号/异常名/URL 模糊搜索', '--limit': '最多取 N 条', '--json': '原始 JSON 输出' },
|
||||
example: [
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { initWebapi, loadLog } from '../../webapi/log.ts'
|
||||
|
||||
@@ -44,7 +44,7 @@ export function buildLogLoginCommand(): Command {
|
||||
console.log(JSON.stringify(d).slice(0, 200))
|
||||
}
|
||||
})
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '登录日志',
|
||||
optional: { '--keyword': '按账号/姓名模糊搜索' },
|
||||
example: 'dacli log login\ndacli log login --keyword=admin',
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { initWebapi, loadLog } from '../../webapi/log.ts'
|
||||
|
||||
@@ -44,7 +44,7 @@ export function buildLogOperateCommand(): Command {
|
||||
console.log(JSON.stringify(d).slice(0, 200))
|
||||
}
|
||||
})
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '操作日志',
|
||||
optional: { '--keyword': '按账号/姓名模糊搜索' },
|
||||
example: 'dacli log operate\ndacli log operate --keyword=admin',
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { initWebapi, loadLog } from '../../webapi/log.ts'
|
||||
|
||||
@@ -51,7 +51,7 @@ export function buildLogRequestCommand(): Command {
|
||||
console.log(`[${time}] ${user} ${method} ${url} ip=${ip} status=${status}`)
|
||||
}
|
||||
})
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '请求日志 (API 调用审计). 排查 API 调用失败 / IP 异常.',
|
||||
optional: { '--keyword': '按账号/URL 模糊搜索', '--limit': '最多取 N 条', '--json': '原始 JSON 输出' },
|
||||
example: [
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { loadContextSafe } from '../_precheck.ts'
|
||||
import { runGuards, handleGuardResult } from '../_blindspot_guards.ts'
|
||||
@@ -367,7 +367,7 @@ export function buildMenuCreateCommand(): Command {
|
||||
return
|
||||
})
|
||||
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '创建菜单. 挂表单菜单 (--formId) 走 web 真路径 Actions/Module, 后端自动处理所有字段. v0.11d+ 加 step machine 校验 (4 step 镜像 web Form.vue + 后端 ModuleController.create, 聚合错误, AI 不用去浏览器试错)',
|
||||
required: { '--fullName': '中文名' },
|
||||
optional: {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log } from '../../core/log.ts'
|
||||
import { fetchMenuTree, findByEnCode, flattenTree } from './_helpers.ts'
|
||||
import { initWebapi, loadMenu } from '../../webapi/menu.ts'
|
||||
@@ -105,7 +105,7 @@ export function buildMenuDeleteCommand(): Command {
|
||||
log.info(`汇总: ${ok} 成功 / ${fail} 失败`)
|
||||
if (fail) process.exit(1)
|
||||
})
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '删除菜单. v0.7+ 支持 --enCode (容错 hash 后缀) / --cascade (递归子菜单) / --fallback (失败兜底).',
|
||||
required: { '--id 或 --enCode': '二选一', '--yes': '确认' },
|
||||
optional: {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { initWebapi, loadMenu } from '../../webapi/menu.ts'
|
||||
|
||||
@@ -61,7 +61,7 @@ export function buildMenuInfoCommand(): Command {
|
||||
}
|
||||
})
|
||||
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '拉菜单完整 schema. 用于诊断"菜单创建了但侧边栏不显示"等问题 (BS-43/BS-50 防御).',
|
||||
required: { '--id': '菜单 id' },
|
||||
optional: { '--json': '原始 JSON 输出' },
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { fetchAllFormReleasedMenus, type FormReleasedMenu } from './_helpers.ts'
|
||||
import { initWebapi, loadMenu } from '../../webapi/menu.ts'
|
||||
@@ -87,7 +87,7 @@ export function buildMenuListCommand(): Command {
|
||||
}
|
||||
})
|
||||
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '列出当前 app 的菜单树 (按请求头 App-Code 过滤).',
|
||||
required: {},
|
||||
optional: {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log } from '../../core/log.ts'
|
||||
import { fetchFormReleasedMenus } from './_helpers.ts'
|
||||
import { initWebapi as initMenuWebapi, loadMenu } from '../../webapi/menu.ts'
|
||||
@@ -69,7 +69,7 @@ export function buildMenuPurgeCommand(): Command {
|
||||
if (fail) process.exit(1)
|
||||
})
|
||||
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '按 formId 删除所有挂载菜单 (PC+APP). 走 getReleaseMenu → DELETE 真实删菜单, vs unrelease 只重置 form 关联.',
|
||||
required: { '--formId': '表单 id' },
|
||||
optional: { '--yes': '跳过确认', '--unrelease': '同时清 form 挂载状态' },
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { fetchFormReleasedMenus } from './_helpers.ts'
|
||||
|
||||
@@ -37,7 +37,7 @@ export function buildMenuReleasesCommand(): Command {
|
||||
}
|
||||
})
|
||||
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '查 form 已挂的菜单 (走 web 真实端点 getReleaseMenu, 之前 dacli 缺).',
|
||||
required: { '--formId': '表单 id' },
|
||||
optional: { '--json': '原始 JSON 输出' },
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log } from '../../core/log.ts'
|
||||
import { initWebapi, loadVisualDev } from '../../webapi/visualDev.ts'
|
||||
import { enhanceFromBackend, formatErrorLine } from '../_error_codes.ts'
|
||||
@@ -40,7 +40,7 @@ export function buildMenuUnreleaseCommand(): Command {
|
||||
}
|
||||
log.ok(`✓ 已取消挂菜单 (formId=${opts.formId})`)
|
||||
})
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '取消 form 的菜单发布. 用于 dacli menu delete 失败时兜底 (DELETE /api/system/Menu/X 报 System abnormality).',
|
||||
required: { '--formId': '表单 id' },
|
||||
example: 'dacli menu unrelease --formId=835141398800901061',
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { initWebapi, loadMenu } from '../../webapi/menu.ts'
|
||||
import { enhanceFromBackend, formatErrorLine } from '../_error_codes.ts'
|
||||
@@ -190,7 +190,7 @@ export function buildMenuUpdateCommand(): Command {
|
||||
if (opts.json) printJson({ id: menuId, ...body, _propertyJsonParsed: propertyJsonObj })
|
||||
})
|
||||
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '菜单修改 (B-20 NEW-CMD). 改 urlAddress/enCode/propertyJson (镜像 web Menu/Form.vue handleSubmit). 杀手特性 --formEnCode 一键同步 form enCode 改名后的菜单 urlAddress.',
|
||||
required: { 'menuId (位置参数) 或 --id': '菜单 id' },
|
||||
optional: {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { initWebapi, loadFlowMonitor } from '../../webapi/flowMonitor.ts'
|
||||
|
||||
@@ -32,7 +32,7 @@ export function buildMonitorFlowCommand(): Command {
|
||||
console.log(JSON.stringify(d))
|
||||
}
|
||||
})
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '流程监控 (待办/运行中流程)',
|
||||
example: 'dacli monitor flow',
|
||||
source: { api: 'GET /api/workflow/monitor', ref: 'web/.../api/workFlow/flowMonitor.ts getFlowMonitorList()' },
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { initWebapi, loadOnlineUser } from '../../webapi/onlineUser.ts'
|
||||
|
||||
@@ -34,7 +34,7 @@ export function buildMonitorOnlineCommand(): Command {
|
||||
console.log(`${String(d.id || '').padEnd(30)}${String(d.userName || d.account || '')}`)
|
||||
}
|
||||
})
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '在线用户监控 (当前登录的用户)',
|
||||
example: 'dacli monitor online',
|
||||
source: { api: 'GET /api/system/OnlineUser', ref: 'web/.../api/permission/onlineUser.ts getOnlineUser()' },
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { initWebapi, loadMonitor } from '../../webapi/monitor.ts'
|
||||
|
||||
@@ -39,7 +39,7 @@ export function buildMonitorServerCommand(): Command {
|
||||
console.log(` 运行时间 : ${d.uptime || '-'}`)
|
||||
console.log(` JDK版本 : ${d.jdkVersion || '-'}`)
|
||||
})
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '服务器状态 (CPU/内存/磁盘/JVM, AI 性能诊断最高优先级). v0.11+ webapi.',
|
||||
optional: { '--json': '原始 JSON 输出' },
|
||||
example: ['dacli monitor server', 'dacli monitor server --json'],
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { initWebapi, loadDataInterface } from '../../webapi/di.ts'
|
||||
|
||||
@@ -38,7 +38,7 @@ export function buildMonitorSqlCommand(): Command {
|
||||
console.log(JSON.stringify(d))
|
||||
}
|
||||
})
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: 'SQL 监控 (数据接口调用日志)',
|
||||
required: { '--id': '数据接口 id' },
|
||||
example: 'dacli monitor sql --id=420587863533428357',
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { validateMsgCreate } from './_validate.ts'
|
||||
import { enhanceFromBackend, formatErrorLine } from '../_error_codes.ts'
|
||||
@@ -72,7 +72,7 @@ export function buildMsgNoticeCreateCommand(): Command {
|
||||
log.info(`✓ 通知公告创建成功 id=${id}`)
|
||||
if (opts.json) printJson({ ...(r.data as object), id })
|
||||
})
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '新建通知公告 (草稿, 用 notice-release 发布)',
|
||||
required: { '--fullName': '通知标题', '--enCode': '通知编码' },
|
||||
optional: { '--body': '通知正文' },
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log } from '../../core/log.ts'
|
||||
import { initWebapi, loadNotice } from '../../webapi/message.ts'
|
||||
|
||||
@@ -33,7 +33,7 @@ export function buildMsgNoticeDeleteCommand(): Command {
|
||||
}
|
||||
log.ok(`✓ 公告已删除 (id=${opts.id})`)
|
||||
})
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '通知公告删除',
|
||||
required: { '--id': '公告 id', '--yes': '跳过确认' },
|
||||
example: 'dacli msg noticeDelete --id=123 --yes',
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
|
||||
interface NoticeItem {
|
||||
@@ -57,7 +57,7 @@ export function buildMsgNoticeListCommand(): Command {
|
||||
console.log(`${id}${name}${code}${state}`)
|
||||
}
|
||||
})
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '列出通知公告 (站内信, msgCenter)',
|
||||
optional: { '--keyword': '按名称/编码模糊搜索' },
|
||||
example: 'dacli msg noticelist\ndacli msg noticelist --keyword=系统',
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log } from '../../core/log.ts'
|
||||
|
||||
interface SendOpts {
|
||||
@@ -41,7 +41,7 @@ export function buildMsgNoticeSendCommand(): Command {
|
||||
log.info(` 提示: 走 dacli integration ${opts.type} send (W12+)`)
|
||||
}
|
||||
})
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '发送/发布通知 (决策 8: 通道 site/email/sms/webhook/dingTalk/weCom)',
|
||||
required: { '--id': '通知 id' },
|
||||
optional: { '--type': '发送通道 (默认 site)' },
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { initWebapi, loadNotice } from '../../webapi/message.ts'
|
||||
import { dirtyCheck, dirtyCheckFailAndExit } from '../_dirty_check.ts'
|
||||
@@ -81,7 +81,7 @@ export function buildMsgNoticeUpdateCommand(): Command {
|
||||
log.ok(`✓ 公告更新成功 (id=${opts.id})`)
|
||||
if (opts.json) printJson(r.data)
|
||||
})
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '通知公告修改. 改 fullName/enCode/body/category, PUT 语义 + v0.11e+ dirty check.',
|
||||
required: { '--id': '公告 id' },
|
||||
optional: {
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { validateMsgCreate } from './_validate.ts'
|
||||
import { enhanceFromBackend, formatErrorLine } from '../_error_codes.ts'
|
||||
@@ -78,7 +78,7 @@ export function buildMsgTemplateCreateCommand(): Command {
|
||||
log.info(`✓ 消息模板创建成功 id=${id}`)
|
||||
if (opts.json) printJson({ ...(r.data as object), id })
|
||||
})
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '新建消息模板 (修复 v0.10 错误端点)',
|
||||
required: { '--fullName': '模板名称', '--enCode': '模板编码' },
|
||||
optional: {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log } from '../../core/log.ts'
|
||||
import { initWebapi, loadMsgTemplate } from '../../webapi/message.ts'
|
||||
|
||||
@@ -33,7 +33,7 @@ export function buildMsgTemplateDeleteCommand(): Command {
|
||||
}
|
||||
log.ok(`✓ 模板已删除 (id=${opts.id})`)
|
||||
})
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '消息模板删除',
|
||||
required: { '--id': '模板 id', '--yes': '跳过确认' },
|
||||
example: 'dacli msg templateDelete --id=123 --yes',
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
|
||||
interface TemplateItem {
|
||||
@@ -55,7 +55,7 @@ export function buildMsgTemplateListCommand(): Command {
|
||||
console.log(`${id}${name}${code}${en}`)
|
||||
}
|
||||
})
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '列出消息模板 (站内信/邮件/短信 模板)',
|
||||
optional: { '--keyword': '按名称/编码模糊搜索' },
|
||||
example: 'dacli msg templatelist\ndacli msg templatelist --keyword=告警',
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { initWebapi, loadMsgTemplate } from '../../webapi/message.ts'
|
||||
|
||||
@@ -55,7 +55,7 @@ export function buildMsgTemplateUpdateCommand(): Command {
|
||||
log.ok(`✓ 模板更新成功 (id=${opts.id})`)
|
||||
if (opts.json) printJson(r.data)
|
||||
})
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '消息模板修改',
|
||||
required: { '--id': '模板 id' },
|
||||
optional: { '--fullName': '模板名', '--enCode': '英文编码', '--category': '分类', '--content': '内容', '--enabledMark': '启用/禁用' },
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { validateOrgCreate } from './_validate.ts'
|
||||
import { enhanceFromBackend, formatErrorLine } from '../_error_codes.ts'
|
||||
@@ -92,7 +92,7 @@ export function buildOrgCreateCommand(): Command {
|
||||
log.info(`✓ 组织创建成功 id=${id}`)
|
||||
if (opts.json) printJson({ ...(r as object), id })
|
||||
})
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '新建组织 (v0.11e+ Phase D1 + step machine 校验, 镜像 web organize/Form.vue + 后端 OrganizeController + PS013/PS036)',
|
||||
required: {
|
||||
'--fullName': '组织名称',
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
|
||||
interface OrgItem {
|
||||
@@ -59,7 +59,7 @@ export function buildOrgListCommand(): Command {
|
||||
console.log(`${idShort} ${name} ${parent} ${cat} ${ch}`)
|
||||
}
|
||||
})
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '列出组织树 (P1 权限三角 3 号)',
|
||||
optional: { '--parentId': '从指定父节点展开 (默认 "0" 根)' },
|
||||
example: 'dacli org list\ndacli org list --parentId=829724597300494342',
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log } from '../../core/log.ts'
|
||||
|
||||
interface OrgItem {
|
||||
@@ -62,7 +62,7 @@ export function buildOrgTreeCommand(): Command {
|
||||
console.log('组织树 (单层, maxDepth=' + opts.maxDepth + '):')
|
||||
printTree(list, 0, opts.parentId || '0')
|
||||
})
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '组织树形结构 (单层展示)',
|
||||
optional: { '--parentId': '根节点 id (默认 "0")', '--maxDepth': '最大深度' },
|
||||
example: 'dacli org tree\ndacli org tree --parentId=829724597300494342',
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { validatePortalCreate } from './_validate.ts'
|
||||
import { enhanceFromBackend, formatErrorLine } from '../_error_codes.ts'
|
||||
@@ -243,7 +243,7 @@ export function buildPortalCreateCommand(): Command {
|
||||
if (opts.json)
|
||||
printJson({ ...(r as object), id, category: realCategoryId, categoryName: resolvedCategory.name })
|
||||
})
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '新建门户 (首页/工作台设计器产物)',
|
||||
required: {
|
||||
'--fullName': '门户名称',
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { initWebapi as initPortalWebapi, loadPortal } from '../../webapi/portal.ts'
|
||||
|
||||
@@ -41,7 +41,7 @@ export function buildPortalInfoCommand(): Command {
|
||||
console.log(`--- 完整 JSON (含 formData 布局) ---`)
|
||||
printJson(d)
|
||||
})
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '查看门户的完整 schema (含布局/组件)',
|
||||
required: { '--id': '门户 id' },
|
||||
example: 'dacli portal info --id=1234567890\ndacli portal info --id=1234567890 --json',
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*/
|
||||
import { Command } from 'commander'
|
||||
import { JnpfClient } from '../../core/client.ts'
|
||||
import { installAiHelpHook } from '../../core/help.ts'
|
||||
import { installHelpHook } from '../../core/help.ts'
|
||||
import { log, printJson } from '../../core/log.ts'
|
||||
import { initWebapi as initPortalWebapi, loadPortal } from '../../webapi/portal.ts'
|
||||
|
||||
@@ -48,7 +48,7 @@ export function buildPortalListCommand(): Command {
|
||||
console.log(`${id}${name}${code}${cat}`)
|
||||
}
|
||||
})
|
||||
installAiHelpHook(cmd, {
|
||||
installHelpHook(cmd, {
|
||||
purpose: '列出门户 (门户设计器产物)',
|
||||
optional: { '--keyword': '按名称/编码模糊搜索' },
|
||||
example: 'dacli portal list\ndacli portal list --keyword=工作台',
|
||||
|
||||
Loaded 100 of 169 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user