Files
hose-use/src/domains/platform/workflow/models/nodes/utility.ts
T
gitea 74234f3ed1 feat(workflow): 补齐可用节点原子模型定义与静态门禁已知类型识别
1. 节点原子模型与 Schema 补齐:
   - 在 src/domains/platform/workflow/models/nodes/ 下新增 ai.ts, control.ts, message.ts, org.ts, utility.ts;
   - 补齐 flow-update-task、recalculate-the-approval-flow、flow-list、message-dingtalk、excel、ai-classification 等 30+ 节点强类型 Schema;
   - 统一导出并重现生成 specs/workflow-schema.json。
2. 静态分析门禁已知节点对齐:
   - 引入 isKnownGrayNodeType 使得静态分析器全面识别 108 官方灰度节点清单;
   - 消除 recalculate-the-approval-flow、flow-update-task 等官方已知节点的误报 UNKNOWN_TASK_TYPE 警告。
3. 文档与规范同步:
   - 更新 src/domains/platform/workflow/models/nodes/README.nodes.md 文件职责表;
   - 通过 check-readme、全量 966 单测及 tsc 零报错校验。
2026-11-02 23:51:31 +08:00

81 lines
2.9 KiB
TypeScript

import { z } from "zod";
import { BaseTaskSchema, OnErrorSchema } from "./common.js";
// ── 基础通用/工具类节点 ────────────────────────────────────────────────────────
export const ExcelTaskSchema = BaseTaskSchema.extend({
type: z.literal("excel"),
onError: OnErrorSchema.optional(),
}).passthrough();
export const AggregationTaskSchema = BaseTaskSchema.extend({
type: z.literal("aggregation"),
list: z.any().optional(),
groupBy: z.any().optional(),
onError: OnErrorSchema.optional(),
}).passthrough();
export const FlowFormatTaskSchema = BaseTaskSchema.extend({
type: z.literal("flow-format"),
onError: OnErrorSchema.optional(),
}).passthrough();
export const TaskLogTaskSchema = BaseTaskSchema.extend({
type: z.literal("task-log"),
message: z.string().optional(),
onError: OnErrorSchema.optional(),
}).passthrough();
export const TaskDynamicTestTaskSchema = BaseTaskSchema.extend({
type: z.literal("task-dynamic-test"),
onError: OnErrorSchema.optional(),
}).passthrough();
export const TaskOpenapiTaskSchema = BaseTaskSchema.extend({
type: z.literal("task-openapi"),
onError: OnErrorSchema.optional(),
}).passthrough();
export const ContextTaskSchema = BaseTaskSchema.extend({
type: z.literal("context"),
onError: OnErrorSchema.optional(),
}).passthrough();
export const DmnTaskSchema = BaseTaskSchema.extend({
type: z.literal("dmn"),
onError: OnErrorSchema.optional(),
}).passthrough();
export const MappingTaskSchema = BaseTaskSchema.extend({
type: z.literal("mapping"),
onError: OnErrorSchema.optional(),
}).passthrough();
export const UiDialogTaskSchema = BaseTaskSchema.extend({
type: z.literal("ui-dialog"),
onError: OnErrorSchema.optional(),
}).passthrough();
export const UiNotificationTaskSchema = BaseTaskSchema.extend({
type: z.literal("ui-notification"),
onError: OnErrorSchema.optional(),
}).passthrough();
export const OutputTaskSchema = BaseTaskSchema.extend({
type: z.literal("output"),
onError: OnErrorSchema.optional(),
}).passthrough();
export type ExcelTask = z.infer<typeof ExcelTaskSchema>;
export type AggregationTask = z.infer<typeof AggregationTaskSchema>;
export type FlowFormatTask = z.infer<typeof FlowFormatTaskSchema>;
export type TaskLogTask = z.infer<typeof TaskLogTaskSchema>;
export type TaskDynamicTestTask = z.infer<typeof TaskDynamicTestTaskSchema>;
export type TaskOpenapiTask = z.infer<typeof TaskOpenapiTaskSchema>;
export type ContextTask = z.infer<typeof ContextTaskSchema>;
export type DmnTask = z.infer<typeof DmnTaskSchema>;
export type MappingTask = z.infer<typeof MappingTaskSchema>;
export type UiDialogTask = z.infer<typeof UiDialogTaskSchema>;
export type UiNotificationTask = z.infer<typeof UiNotificationTaskSchema>;
export type OutputTask = z.infer<typeof OutputTaskSchema>;