- 数据库迁移与本地缓存:在 `core/db/migrations.ts` 新增 version 5 迁移 (`005_workflow_job_cache`),创建 `workflow_job_index` 缓存表及高效复合索引;实现 `core/db/workflow-job-cache.ts`,支持按企业+工作流+单号快速检索与幂等增量缓存; - 流式早停探查与业务编排:在 `domains/platform/workflow/execution/search-by-flow.ts` 实现 `searchWorkflowJobByFlowCode`,采用「本地 SQLite 缓存 0ms 直达 ➔ 远端流式探查早停熔断并自动建立本地索引」机制,彻底解决云端 Piper API 无单号索引导致的排查低效问题; - CLI 命令层升级: - `workflow logs <pipelineId> --flow=<单号>`:直接秒级定位单据关联 Job 实例; - `platform records <业务对象>`:支持单参数业务对象名称,自动在企业全量自建应用中全局反查与智能寻址,若跨应用重名则抛出精准候选; - 命令行元数据对齐:在 `command-metadata.ts` 为 `workflow` 补齐 `--max-pages`、`--maxPages` 与 `--page-limit` 选项注册,满足严格参数词汇表静态检查; - 测试与文档:新增并更新 `workflow-job-cache.test.ts`、`search-by-flow.test.ts`、`platform.test.ts` 与 `db.test.ts`,更新核心与域层文档,全量 1126 个测试与类型检查全部通过。
99 lines
2.3 KiB
TypeScript
99 lines
2.3 KiB
TypeScript
// workflow 业务服务出口;具体实现按职责拆分,内部模块避免反向导入此门面。
|
|
export {
|
|
listWorkflows,
|
|
getWorkflowStats,
|
|
getWorkflowCharge,
|
|
getWorkflowDetail,
|
|
listWorkflowSnapshots,
|
|
getWorkflowSnapshot,
|
|
listAllWorkflows,
|
|
findWorkflowsByTaskType,
|
|
} from "./management/queries.js";
|
|
export {
|
|
listWorkflowLogs,
|
|
listRunningJobs,
|
|
getJob,
|
|
getJobExecutionTree,
|
|
getJobFailedExecutions,
|
|
getJobExecutionLevel,
|
|
getExecutionLogs,
|
|
} from "./execution/queries.js";
|
|
export {
|
|
searchWorkflowJobByFlowCode,
|
|
extractJobFlowCode,
|
|
type SearchJobByFlowOptions,
|
|
type SearchJobByFlowResult,
|
|
} from "./execution/search-by-flow.js";
|
|
export type {
|
|
WorkflowClients,
|
|
ListAllWorkflowsOptions,
|
|
ListAllWorkflowsResult,
|
|
FindWorkflowsByTaskTypeOptions,
|
|
FindWorkflowsByTaskTypeResult,
|
|
} from "./management/queries.js";
|
|
export {
|
|
sanitizeWorkflowSnapshot,
|
|
updateWorkflow,
|
|
refreshWorkflowChooses,
|
|
copyWorkflow,
|
|
buildInitialTriggerTask,
|
|
createWorkflow,
|
|
deleteWorkflow,
|
|
toggleWorkflow,
|
|
type CreateWorkflowOptions,
|
|
} from "./management/configuration.js";
|
|
export type { WorkflowToggleResult } from "./models/workflow.js";
|
|
export {
|
|
listDsl,
|
|
listStaffs,
|
|
getWorkflowEnumOptions,
|
|
resolveWorkflowEnumOptions,
|
|
getWorkflowAvailableNodes,
|
|
grantWorkflowNodes,
|
|
GRANT_ATTACHED_OPTIONS,
|
|
} from "./catalog/catalog.js";
|
|
export {
|
|
getWebhookInfo,
|
|
sampleWorkflowData,
|
|
getWorkflowDebugSource,
|
|
triggerWorkflowDebug,
|
|
runWorkflowDebugTest,
|
|
getWorkflowSampleData,
|
|
} from "./execution/debug.js";
|
|
export {
|
|
flattenExecutionTree,
|
|
isTaskExecutionFailed,
|
|
extractFailureExecutions,
|
|
findExecutionNode,
|
|
flattenWorkflowTasks,
|
|
} from "./execution/tree.js";
|
|
export {
|
|
generateTextDiff,
|
|
diffWorkflowSnapshots,
|
|
diffWorkflowJobs,
|
|
} from "./comparison/diff.js";
|
|
|
|
export {
|
|
explainConditionBranches,
|
|
type ConditionBranchExplanation,
|
|
type ConditionRuleExplanation,
|
|
} from "./branch/index.js";
|
|
|
|
export {
|
|
classifyWorkflowTrigger,
|
|
type WorkflowTriggerCategory,
|
|
type WorkflowSampleRecord,
|
|
type WorkflowSampleDataResult,
|
|
} from "./types.js";
|
|
|
|
export * from "./index.js";
|
|
export { webhookTriggerUrl } from "./triggers/index.js";
|
|
export {
|
|
getOutboundMessages,
|
|
queryOutboundMessageLogs,
|
|
type OutboundMessageConfig,
|
|
type OutboundMessageLogItem,
|
|
type OutboundLogQueryOptions,
|
|
} from "./transport/outbound/index.js";
|
|
|