fix(web): 修复变量校验没有包含入参
This commit is contained in:
@@ -7,14 +7,15 @@ import OutputNode from './node/OutputNode.tsx'
|
||||
import SwitchNode from './node/SwitchNode.tsx'
|
||||
import type {NodeChecker} from './types.ts'
|
||||
|
||||
const inputVariableChecker: NodeChecker = (id, nodes, edges, data) => {
|
||||
const inputVariableChecker: NodeChecker = (id, inputSchema, nodes, edges, data) => {
|
||||
let nodeData = data[id] ?? {}
|
||||
if (has(nodeData, 'inputs')) {
|
||||
let inputs = nodeData?.inputs ?? {}
|
||||
if (!isEmpty(inputs)) {
|
||||
let outputVariables = new Set(
|
||||
getAllIncomerNodeOutputVariables(id, nodes, edges, data).map(i => `${i.id}.${i.variable}`),
|
||||
)
|
||||
let outputVariables = new Set([
|
||||
...getAllIncomerNodeOutputVariables(id, nodes, edges, data).map(i => `${i.id}.${i.variable}`),
|
||||
...Object.keys(inputSchema)
|
||||
])
|
||||
for (const key of Object.keys(inputs)) {
|
||||
let variable = inputs[key]?.variable ?? ''
|
||||
if (!outputVariables.has(variable)) {
|
||||
|
||||
Reference in New Issue
Block a user