MCPcopy Create free account
hub / github.com/FlowiseAI/Flowise / pickNodeData

Function pickNodeData

packages/agentflow/src/core/utils/nodeFactory.ts:107–128  ·  view source on GitHub ↗

* Pick only the properties that belong to NodeData from an API response. * Strips server-only metadata (filePath, author, loadMethods, etc.) * that should not be persisted in flow data. * * Preserves component metadata needed at runtime (badge, tags, documentation) * for display in the NodeInfo

(raw: NodeDataSchema)

Source from the content-addressed store, hash-verified

105 * for display in the NodeInfoDialog.
106 */
107function pickNodeData(raw: NodeDataSchema): Partial<NodeData> {
108 return {
109 name: raw.name,
110 label: raw.label,
111 type: raw.type,
112 category: raw.category,
113 description: raw.description,
114 version: raw.version,
115 baseClasses: raw.baseClasses,
116 // API `inputs` (schema) → canvas `inputParams`; `NodeData.inputs` is the value map only.
117 inputParams: raw.inputs,
118 outputs: raw.outputs,
119 inputAnchors: raw.inputAnchors,
120 outputAnchors: raw.outputAnchors,
121 color: raw.color,
122 icon: raw.icon,
123 hideInput: raw.hideInput,
124 badge: raw.badge,
125 tags: raw.tags,
126 documentation: raw.documentation
127 }
128}
129
130/**
131 * Initialize a node with proper anchors and default values.

Callers 1

initNodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected