mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 10:31:15 +00:00
fix(core): Avoid using structuredClone on node descriptions (#13832)
This commit is contained in:
committed by
GitHub
parent
0d7894f06a
commit
d2df154b49
@@ -26,7 +26,7 @@ import type {
|
|||||||
IVersionedNodeType,
|
IVersionedNodeType,
|
||||||
INodeProperties,
|
INodeProperties,
|
||||||
} from 'n8n-workflow';
|
} from 'n8n-workflow';
|
||||||
import { NodeConnectionType, UnexpectedError, UserError } from 'n8n-workflow';
|
import { deepCopy, NodeConnectionType, UnexpectedError, UserError } from 'n8n-workflow';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import picocolors from 'picocolors';
|
import picocolors from 'picocolors';
|
||||||
|
|
||||||
@@ -315,12 +315,11 @@ export class LoadNodesAndCredentials {
|
|||||||
this.types.nodes.filter((nodetype) => nodetype.usableAsTool === true);
|
this.types.nodes.filter((nodetype) => nodetype.usableAsTool === true);
|
||||||
|
|
||||||
for (const usableNode of usableNodes) {
|
for (const usableNode of usableNodes) {
|
||||||
const description: INodeTypeBaseDescription | INodeTypeDescription =
|
const description = deepCopy(usableNode);
|
||||||
structuredClone(usableNode);
|
|
||||||
const wrapped = this.convertNodeToAiTool({ description }).description;
|
const wrapped = this.convertNodeToAiTool({ description }).description;
|
||||||
|
|
||||||
this.types.nodes.push(wrapped);
|
this.types.nodes.push(wrapped);
|
||||||
this.known.nodes[wrapped.name] = structuredClone(this.known.nodes[usableNode.name]);
|
this.known.nodes[wrapped.name] = { ...this.known.nodes[usableNode.name] };
|
||||||
|
|
||||||
const credentialNames = Object.entries(this.known.credentials)
|
const credentialNames = Object.entries(this.known.credentials)
|
||||||
.filter(([_, credential]) => credential?.supportedNodes?.includes(usableNode.name))
|
.filter(([_, credential]) => credential?.supportedNodes?.includes(usableNode.name))
|
||||||
|
|||||||
Reference in New Issue
Block a user