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

@@ -2,6 +2,9 @@
export const BINARY_ENCODING = 'base64';
export const WAIT_TIME_UNLIMITED = '3000-01-01T00:00:00.000Z';
export const CODE_LANGUAGES = ['javaScript', 'json', 'python'] as const;
export const CODE_EXECUTION_MODES = ['runOnceForAllItems', 'runOnceForEachItem'] as const;
/**
* Nodes whose parameter values may refer to other nodes without expressions.
* Their content may need to be updated when the referenced node is renamed.

View File

@@ -7,7 +7,9 @@ import type { Readable } from 'stream';
import type { URLSearchParams } from 'url';
import type { OptionsWithUri, OptionsWithUrl } from 'request';
import type { RequestPromiseOptions, RequestPromiseAPI } from 'request-promise-native';
import type { PathLike } from 'fs';
import type { CODE_EXECUTION_MODES, CODE_LANGUAGES } from './Constants';
import type { IDeferredPromise } from './DeferredPromise';
import type { Workflow } from './Workflow';
import type { WorkflowHooks } from './WorkflowHooks';
@@ -15,7 +17,6 @@ import type { WorkflowActivationError } from './WorkflowActivationError';
import type { WorkflowOperationError } from './WorkflowErrors';
import type { NodeApiError, NodeOperationError } from './NodeErrors';
import type { ExpressionError } from './ExpressionError';
import type { PathLike } from 'fs';
import type { ExecutionStatus } from './ExecutionStatus';
import type { AuthenticationMethod } from './Authentication';
@@ -635,12 +636,12 @@ namespace ExecuteFunctions {
fallbackValue?: number,
options?: IGetNodeParameterOptions,
): number;
getNodeParameter(
getNodeParameter<T = NodeParameterValueType | object>(
parameterName: string,
itemIndex: number,
fallbackValue?: any,
options?: IGetNodeParameterOptions,
): NodeParameterValueType | object;
): T;
};
}
@@ -1020,7 +1021,8 @@ export type NodePropertyTypes =
export type CodeAutocompleteTypes = 'function' | 'functionItem';
export type EditorType = 'code' | 'codeNodeEditor' | 'htmlEditor' | 'sqlEditor' | 'json';
export type CodeNodeEditorLanguage = 'javaScript' | 'json'; //| 'python' | 'sql';
export type CodeNodeEditorLanguage = (typeof CODE_LANGUAGES)[number];
export type CodeExecutionMode = (typeof CODE_EXECUTION_MODES)[number];
export type SQLDialect = 'mssql' | 'mysql' | 'postgres';
export interface ILoadOptions {