mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
feat(Code Node): Add Python support (#4295)
This commit is contained in:
@@ -0,0 +1,76 @@
|
||||
import type { INodeProperties } from 'n8n-workflow';
|
||||
|
||||
const commonDescription: INodeProperties = {
|
||||
displayName: 'JavaScript',
|
||||
name: 'jsCode',
|
||||
type: 'string',
|
||||
typeOptions: {
|
||||
editor: 'codeNodeEditor',
|
||||
editorLanguage: 'javaScript',
|
||||
},
|
||||
default: '',
|
||||
description:
|
||||
'JavaScript code to execute.<br><br>Tip: You can use luxon vars like <code>$today</code> for dates and <code>$jmespath</code> for querying JSON structures. <a href="https://docs.n8n.io/nodes/n8n-nodes-base.function">Learn more</a>.',
|
||||
noDataExpression: true,
|
||||
};
|
||||
|
||||
const v1Properties: INodeProperties[] = [
|
||||
{
|
||||
...commonDescription,
|
||||
displayOptions: {
|
||||
show: {
|
||||
'@version': [1],
|
||||
mode: ['runOnceForAllItems'],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
...commonDescription,
|
||||
displayOptions: {
|
||||
show: {
|
||||
'@version': [1],
|
||||
mode: ['runOnceForEachItem'],
|
||||
},
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
const v2Properties: INodeProperties[] = [
|
||||
{
|
||||
...commonDescription,
|
||||
displayOptions: {
|
||||
show: {
|
||||
'@version': [2],
|
||||
language: ['javaScript'],
|
||||
mode: ['runOnceForAllItems'],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
...commonDescription,
|
||||
displayOptions: {
|
||||
show: {
|
||||
'@version': [2],
|
||||
language: ['javaScript'],
|
||||
mode: ['runOnceForEachItem'],
|
||||
},
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
export const javascriptCodeDescription: INodeProperties[] = [
|
||||
...v1Properties,
|
||||
...v2Properties,
|
||||
{
|
||||
displayName:
|
||||
'Type <code>$</code> for a list of <a target="_blank" href="https://docs.n8n.io/code-examples/methods-variables-reference/">special vars/methods</a>. Debug by using <code>console.log()</code> statements and viewing their output in the browser console.',
|
||||
name: 'notice',
|
||||
type: 'notice',
|
||||
displayOptions: {
|
||||
show: {
|
||||
language: ['javaScript'],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
},
|
||||
];
|
||||
Reference in New Issue
Block a user