auto(bfc0cfa2c3a4): session end @ 2026-07-20T14:09:33 (+11f)

This commit is contained in:
ssw committed 2026-07-20 14:09:35 +08:00
1 parent cd724ca53e
commit a10a829a86
11 files changed
+41

No files matched your search

+3
View File
@@ -7,6 +7,7 @@ import { Command } from 'commander'
import { JnpfClient } from '../../core/client.ts'
import { installHelpHook } from '../../core/help.ts'
import { log, printJson } from '../../core/log.ts'
import { setupOutputFilter } from './_output.ts'
interface Opts {
operatorId: string
@@ -21,8 +22,10 @@ export function buildWorkflowApproveCommand(): Command {
.requiredOption('--operatorId <id>', '审批节点 id (operatorId)')
.requiredOption('--status <0|1|2>', '0=同意 1=不同意 2=退回', '0')
.option('--opinion <text>', '审批意见')
.option('--verbose', '完整输出 (含 step machine、API 调用等过程日志)', false)
.option('--json', '原始 JSON 输出', false)
.action(async (opts: Opts) => {
setupOutputFilter(opts)
const c = await JnpfClient.fromToken()
const body = {
status: Number(opts.status),
+11
View File
@@ -23,6 +23,7 @@ import { Command } from 'commander'
import { JnpfClient } from '../../core/client.ts'
import { installHelpHookWithPatterns } from '../../core/help.ts'
import { log, printJson } from '../../core/log.ts'
import { setupOutputFilter, printCommandEnd } from './_output.ts'
import { callAiWorkflow, detectTrivialFlowXml } from '../form/_ai.ts'
import { buildFlowNodes, validateFlowNodeStructure } from './_webapi_helpers.ts'
import { autoLayoutFlowXml, isLayoutNeeded } from './_autoLayout.ts'
@@ -84,8 +85,12 @@ export function buildWorkflowCreateCommand(): Command {
.option('--layoutThreshold <n>', 'isLayoutNeeded 重叠阈值 (0-1, 默认 0.8 = 80% 触发 autoLayout)', '0.8')
.option('--ai <desc>', 'AI 创建流程 — 自然语言描述, 走 web 端 getAiInfo 拿 flowXml')
.option('--auto-authorize', '创建后自动给当前角色授权', false)
.option('--verbose', '完整输出 (含 step machine、API 调用等过程日志)', false)
.option('--json', '原始 JSON 输出', false)
.action(async (opts: CreateOpts) => {
// 输出过滤: 默认静默 (quiet mode), --verbose 走完整日志, --json 走原始 JSON
// 复用 form 的输出过滤模式 (见 _output.ts)
setupOutputFilter(opts)
const c = await JnpfClient.fromToken()
// (Round 12 enCode 含 `-`/`_` 自动 strip + WARN
@@ -374,6 +379,12 @@ export function buildWorkflowCreateCommand(): Command {
status: item?.status || 1,
})
}
// 输出过滤: 命令结束, 打印摘要 + "详情: dacli log last"
printCommandEnd(opts, 'workflow create', {
id: templateId,
enCode: actualEnCode,
flowId: item?.flowId || versionId,
})
})
installHelpHookWithPatterns(cmd, 'workflow create', {
+3
View File
@@ -14,6 +14,7 @@ import { Command } from 'commander'
import { JnpfClient } from '../../core/client.ts'
import { installHelpHook } from '../../core/help.ts'
import { log, printJson } from '../../core/log.ts'
import { setupOutputFilter } from './_output.ts'
interface DecisionOpts {
list?: boolean
@@ -25,8 +26,10 @@ export function buildWorkflowDecisionCommand(): Command {
.description('决策流参数 (白皮书 5.6.5) — 流程模板的子配置 (漏斗/覆盖/规则集/评分卡/交叉表/异常)')
.argument('[templateId]', '模板 id, 不传且无 --list 则报错')
.option('--list', '列所有 template, 标记是否含决策流节点', false)
.option('--verbose', '完整输出 (含 step machine、API 调用等过程日志)', false)
.option('--json', '原始 JSON 输出', false)
.action(async (templateId: string | undefined, opts: DecisionOpts) => {
setupOutputFilter(opts)
const c = await JnpfClient.fromToken()
if (opts.list) {
// 列所有 template, 调 DecisionParameter 探测 (会慢, 但准确)
+3
View File
@@ -8,6 +8,7 @@ import { Command } from 'commander'
import { JnpfClient } from '../../core/client.ts'
import { installHelpHook } from '../../core/help.ts'
import { log } from '../../core/log.ts'
import { setupOutputFilter } from './_output.ts'
import { initWebapi, loadWorkflow } from '../../webapi/workflow.ts'
interface Opts { id: string; yes?: boolean }
@@ -17,11 +18,13 @@ export function buildWorkflowDeleteCommand(): Command {
.description('流程模板删除 (硬删, 无回收, v0.11+ webapi)')
.requiredOption('--id <id>', '流程模板 id')
.option('--yes', '跳过确认', false)
.option('--verbose', '完整输出 (含 step machine、API 调用等过程日志)', false)
.action(async (opts: Opts) => {
if (!opts.yes) {
log.warn(`即将删除流程模板 id=${opts.id}, 加 --yes 跳过确认`)
process.exit(2)
}
setupOutputFilter(opts)
const c = await JnpfClient.fromToken()
await initWebapi(c)
log.info(`loadWorkflow.delFlow (id=${opts.id})`)
+3
View File
@@ -11,6 +11,7 @@ import { Command } from 'commander'
import { JnpfClient } from '../../core/client.ts'
import { installHelpHook } from '../../core/help.ts'
import { log, printJson } from '../../core/log.ts'
import { setupOutputFilter } from './_output.ts'
import { initWebapi, loadWorkflow } from '../../webapi/workflow.ts'
import { enhanceFromBackend, formatErrorLine } from '../_error_codes.ts'
@@ -20,9 +21,11 @@ export function buildWorkflowInfoCommand(): Command {
const cmd = new Command('info')
.description('流程模板详情 (含 category/enabledMark/version/关联 form, v0.12+ 优先 getFlowInfo 返回完整信息)')
.requiredOption('--id <id>', '流程模板 id')
.option('--verbose', '完整输出 (含 step machine、API 调用等过程日志)', false)
.option('--json', '原始 JSON 输出', false)
.option('--include-internals', '输出 webapi 内部调试字段 (_fullInfoLoaded/_flowIdUsed/_enabledMarkFromList)', false)
.action(async (opts: Opts) => {
setupOutputFilter(opts)
const c = await JnpfClient.fromToken()
await initWebapi(c)
// v0.12+ Bug 4 修复: 优先 getInfo (basic, 必成功), 然后 chain getFlowInfo (full, fallback)
+3
View File
@@ -13,6 +13,7 @@ import { Command } from 'commander'
import { JnpfClient } from '../../core/client.ts'
import { installHelpHook } from '../../core/help.ts'
import { log, printJson } from '../../core/log.ts'
import { setupOutputFilter } from './_output.ts'
interface Opts {
flowId: string
@@ -27,8 +28,10 @@ export function buildWorkflowLaunchCommand(): Command {
.requiredOption('--flowId <id>', '流程模板 id')
.requiredOption('--formId <id>', '绑定的表单 id')
.requiredOption('--data <json>', '表单数据 JSON 字符串 (解析后塞进 formData 字段)')
.option('--verbose', '完整输出 (含 step machine、API 调用等过程日志)', false)
.option('--json', '原始 JSON 输出', false)
.action(async (opts: Opts) => {
setupOutputFilter(opts)
const c = await JnpfClient.fromToken()
// BS-53 (2026-06-28 fksq 复现): JNPF FlowModel 字段是 formData (object), 不是 data (string)
// 旧版 launch.ts 错用 data: opts.data (string), JNPF 后端解析时把字符串当 formData, 业务字段空
+3
View File
@@ -9,6 +9,7 @@ import { Command } from 'commander'
import { JnpfClient } from '../../core/client.ts'
import { installHelpHook } from '../../core/help.ts'
import { log, printJson } from '../../core/log.ts'
import { setupOutputFilter } from './_output.ts'
interface ListOpts {
category?: string
@@ -23,8 +24,10 @@ export function buildWorkflowListCommand(): Command {
.option('--category <c>', '模板分类')
.option('--todo <type>', '我的待办 (1=待审批 2=已审批 3=抄送), 启用此模式时 category 忽略', '0')
.option('--pageSize <s>', '每页', '50')
.option('--verbose', '完整输出 (含 step machine、API 调用等过程日志)', false)
.option('--json', '原始 JSON 输出', false)
.action(async (opts: ListOpts) => {
setupOutputFilter(opts)
const c = await JnpfClient.fromToken()
const todo = Number(opts.todo || '0')
const path = todo > 0
+3
View File
@@ -11,6 +11,7 @@ import { Command } from 'commander'
import { JnpfClient } from '../../core/client.ts'
import { installHelpHook } from '../../core/help.ts'
import { log, printJson } from '../../core/log.ts'
import { setupOutputFilter } from './_output.ts'
import { initWebapi, loadWorkflow } from '../../webapi/workflow.ts'
interface Opts {
@@ -27,8 +28,10 @@ export function buildWorkflowSelectorCommand(): Command {
.option('--keyword <k>', '按编码/名称搜索')
.option('--category <c>', '流程分类')
.option('--formType <t>', '表单类型过滤 (0=全部 1=在线表单 2=系统表单)')
.option('--verbose', '完整输出 (含 step machine、API 调用等过程日志)', false)
.option('--json', '原始 JSON 输出 (推荐 AI 用)', false)
.action(async (opts: Opts) => {
setupOutputFilter(opts)
const c = await JnpfClient.fromToken()
// v0.11+: 用 web 端 getFlowSelector
await initWebapi(c)
+3
View File
@@ -21,6 +21,7 @@ import { Command } from 'commander'
import { JnpfClient } from '../../core/client.ts'
import { installHelpHook } from '../../core/help.ts'
import { log, printJson } from '../../core/log.ts'
import { setupOutputFilter } from './_output.ts'
interface SyncFormOpts {
flowId: string
@@ -33,8 +34,10 @@ export function buildWorkflowSyncFormCommand(): Command {
'同步 workflow formData + form.workflowEnabled (BS-新27 jxcj 2026-07-01, 修 TC-B modal-not-opened)',
)
.requiredOption('--flowId <id>', '工作流模板 id (jnpf flowable templateId)')
.option('--verbose', '完整输出 (含 step machine、API 调用等过程日志)', false)
.option('--json', '原始 JSON 输出', false)
.action(async (opts: SyncFormOpts) => {
setupOutputFilter(opts)
const c = await JnpfClient.fromToken()
// 镜像 web 端 workFlow/template.ts update() + saveFlow() (跟 dacli workflow update 一致端点)
+3
View File
@@ -13,6 +13,7 @@ import { Command } from 'commander'
import { JnpfClient } from '../../core/client.ts'
import { installHelpHook } from '../../core/help.ts'
import { log, printJson } from '../../core/log.ts'
import { setupOutputFilter } from './_output.ts'
interface Opts {
category?: string
@@ -34,8 +35,10 @@ export function buildWorkflowTasksCommand(): Command {
.option('--category <1|2|3|4>', '任务分类 1=待签 2=待办 3=已办 4=抄送 (默认 2)', '2')
.option('--flowId <id>', '按流程模板 id 过滤')
.option('--keyword <kw>', '按关键字模糊搜索 (流程名/发起人/单号)')
.option('--verbose', '完整输出 (含 step machine、API 调用等过程日志)', false)
.option('--json', '原始 JSON 输出', false)
.action(async (opts: Opts) => {
setupOutputFilter(opts)
const c = await JnpfClient.fromToken()
const category = opts.category || '2'
const params: Record<string, string> = {
+3
View File
@@ -8,6 +8,7 @@ import { Command } from 'commander'
import { JnpfClient } from '../../core/client.ts'
import { installHelpHook } from '../../core/help.ts'
import { log, printJson } from '../../core/log.ts'
import { setupOutputFilter } from './_output.ts'
import { initWebapi, loadWorkflow } from '../../webapi/workflow.ts'
import { enhanceFromBackend, formatErrorLine } from '../_error_codes.ts'
import { dirtyCheck, dirtyCheckFailAndExit } from '../_dirty_check.ts'
@@ -41,8 +42,10 @@ export function buildWorkflowUpdateCommand(): Command {
.option('--expected-enCode <e>', 'v0.11e+ Phase A2: 校验 enCode 未变 (防 AI session 误覆盖)')
.option('--expected-state <s>', 'v0.11e+ Phase A2: 校验 enabledMark 未变')
.option('--force', 'v0.11e+ Phase A2: 跳过 dirty check', false)
.option('--verbose', '完整输出 (含 step machine、API 调用等过程日志)', false)
.option('--json', '原始 JSON 输出', false)
.action(async (opts: Opts) => {
setupOutputFilter(opts)
const c = await JnpfClient.fromToken()
await initWebapi(c)
// === step 0 (拉原流程模板 (loadWorkflow.getInfo) ===