feat(Code Node): Add Python support (#4295)

This commit is contained in:
Jan Oberhauser
2023-05-04 20:00:00 +02:00
committed by GitHub
parent 1e6a75f341
commit 35c8510ab6
25 changed files with 962 additions and 591 deletions

View File

@@ -1672,13 +1672,19 @@ export default mixins(
},
async getNewNodeWithDefaultCredential(nodeTypeData: INodeTypeDescription) {
let nodeVersion = nodeTypeData.defaultVersion;
if (nodeVersion === undefined) {
nodeVersion = Array.isArray(nodeTypeData.version)
? nodeTypeData.version.slice(-1)[0]
: nodeTypeData.version;
}
const newNodeData: INodeUi = {
id: uuid(),
name: nodeTypeData.defaults.name as string,
type: nodeTypeData.name,
typeVersion: Array.isArray(nodeTypeData.version)
? nodeTypeData.version.slice(-1)[0]
: nodeTypeData.version,
typeVersion: nodeVersion,
position: [0, 0],
parameters: {},
};