(flowData)
| 585 | } |
| 586 | |
| 587 | export const generateExportFlowData = (flowData) => { |
| 588 | const nodes = flowData.nodes |
| 589 | const edges = flowData.edges |
| 590 | |
| 591 | for (let i = 0; i < nodes.length; i += 1) { |
| 592 | nodes[i].selected = false |
| 593 | const node = nodes[i] |
| 594 | |
| 595 | const newNodeData = { |
| 596 | id: node.data.id, |
| 597 | label: node.data.label, |
| 598 | version: node.data.version, |
| 599 | name: node.data.name, |
| 600 | type: node.data.type, |
| 601 | color: node.data.color, |
| 602 | hideOutput: node.data.hideOutput, |
| 603 | hideInput: node.data.hideInput, |
| 604 | baseClasses: node.data.baseClasses, |
| 605 | tags: node.data.tags, |
| 606 | category: node.data.category, |
| 607 | description: node.data.description, |
| 608 | inputParams: node.data.inputParams, |
| 609 | inputAnchors: node.data.inputAnchors, |
| 610 | inputs: {}, |
| 611 | outputAnchors: node.data.outputAnchors, |
| 612 | outputs: node.data.outputs, |
| 613 | selected: false |
| 614 | } |
| 615 | |
| 616 | // Remove password, file & folder |
| 617 | if (node.data.inputs && Object.keys(node.data.inputs).length) { |
| 618 | const nodeDataInputs = {} |
| 619 | for (const input in node.data.inputs) { |
| 620 | const inputParam = node.data.inputParams.find((inp) => inp.name === input) |
| 621 | if (inputParam && inputParam.type === 'password') continue |
| 622 | if (inputParam && inputParam.type === 'file') continue |
| 623 | if (inputParam && inputParam.type === 'folder') continue |
| 624 | nodeDataInputs[input] = node.data.inputs[input] |
| 625 | } |
| 626 | newNodeData.inputs = nodeDataInputs |
| 627 | } |
| 628 | |
| 629 | nodes[i].data = _removeCredentialId(newNodeData) |
| 630 | } |
| 631 | const exportJson = { |
| 632 | nodes, |
| 633 | edges |
| 634 | } |
| 635 | return exportJson |
| 636 | } |
| 637 | |
| 638 | export const getAvailableNodesForVariable = (nodes, edges, target, targetHandle, includesStart = false) => { |
| 639 | // example edge id = "llmChain_0-llmChain_0-output-outputPrediction-string|json-llmChain_1-llmChain_1-input-promptValues-string" |
no test coverage detected