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 零报错校验。
76 lines
2.8 KiB
TypeScript
76 lines
2.8 KiB
TypeScript
import { z } from "zod";
|
|
import { BaseTaskSchema, OnErrorSchema } from "./common.js";
|
|
|
|
// ── 消息通知相关节点 ──────────────────────────────────────────────────────────
|
|
|
|
export const MessageDingtalkTaskSchema = BaseTaskSchema.extend({
|
|
type: z.literal("message-dingtalk"),
|
|
receiverType: z.string().optional(),
|
|
receivers: z.array(z.any()).optional(),
|
|
content: z.string().optional(),
|
|
title: z.string().optional(),
|
|
onError: OnErrorSchema.optional(),
|
|
}).passthrough();
|
|
|
|
export const MessageFeishuTaskSchema = BaseTaskSchema.extend({
|
|
type: z.literal("message-feishu"),
|
|
receiverType: z.string().optional(),
|
|
receivers: z.array(z.any()).optional(),
|
|
content: z.string().optional(),
|
|
onError: OnErrorSchema.optional(),
|
|
}).passthrough();
|
|
|
|
export const FeishuSendMsgTaskSchema = BaseTaskSchema.extend({
|
|
type: z.literal("feishu-sendMsg"),
|
|
receiverType: z.string().optional(),
|
|
receivers: z.array(z.any()).optional(),
|
|
content: z.string().optional(),
|
|
onError: OnErrorSchema.optional(),
|
|
}).passthrough();
|
|
|
|
export const MessageSmsTaskSchema = BaseTaskSchema.extend({
|
|
type: z.literal("message"),
|
|
receivers: z.array(z.any()).optional(),
|
|
content: z.string().optional(),
|
|
onError: OnErrorSchema.optional(),
|
|
}).passthrough();
|
|
|
|
export const EmailTaskSchema = BaseTaskSchema.extend({
|
|
type: z.literal("email"),
|
|
receivers: z.array(z.any()).optional(),
|
|
title: z.string().optional(),
|
|
content: z.string().optional(),
|
|
onError: OnErrorSchema.optional(),
|
|
}).passthrough();
|
|
|
|
export const MessageInternetTaskSchema = BaseTaskSchema.extend({
|
|
type: z.literal("message-internet"),
|
|
receivers: z.array(z.any()).optional(),
|
|
title: z.string().optional(),
|
|
content: z.string().optional(),
|
|
onError: OnErrorSchema.optional(),
|
|
}).passthrough();
|
|
|
|
export const MessageOutnetTaskSchema = BaseTaskSchema.extend({
|
|
type: z.literal("message-outnet"),
|
|
receivers: z.array(z.any()).optional(),
|
|
content: z.string().optional(),
|
|
onError: OnErrorSchema.optional(),
|
|
}).passthrough();
|
|
|
|
export const OaReminderTaskSchema = BaseTaskSchema.extend({
|
|
type: z.literal("oa"),
|
|
receivers: z.array(z.any()).optional(),
|
|
content: z.string().optional(),
|
|
onError: OnErrorSchema.optional(),
|
|
}).passthrough();
|
|
|
|
export type MessageDingtalkTask = z.infer<typeof MessageDingtalkTaskSchema>;
|
|
export type MessageFeishuTask = z.infer<typeof MessageFeishuTaskSchema>;
|
|
export type FeishuSendMsgTask = z.infer<typeof FeishuSendMsgTaskSchema>;
|
|
export type MessageSmsTask = z.infer<typeof MessageSmsTaskSchema>;
|
|
export type EmailTask = z.infer<typeof EmailTaskSchema>;
|
|
export type MessageInternetTask = z.infer<typeof MessageInternetTaskSchema>;
|
|
export type MessageOutnetTask = z.infer<typeof MessageOutnetTaskSchema>;
|
|
export type OaReminderTask = z.infer<typeof OaReminderTaskSchema>;
|