n8n-workflow
Advanced tools
Comparing version 0.97.0 to 0.98.0
@@ -521,2 +521,4 @@ /// <reference types="node" /> | ||
sortable?: boolean; | ||
truncate?: boolean; | ||
truncateAt?: number; | ||
[key: string]: any; | ||
@@ -725,3 +727,3 @@ } | ||
export interface INodeTypeDescription extends INodeTypeBaseDescription { | ||
version: number; | ||
version: number | number[]; | ||
defaults: INodeParameters; | ||
@@ -728,0 +730,0 @@ eventTriggerDescription?: string; |
import { IContextObject, INode, INodeCredentialDescription, INodeExecutionData, INodeIssues, INodeParameters, INodeProperties, INodeType, INodeVersionedType, IParameterDependencies, IRunExecutionData, IWebhookData, IWorkflowExecuteAdditionalData, NodeParameterValue } from './Interfaces'; | ||
import { Workflow } from './Workflow'; | ||
export declare function getSpecialNodeParameters(nodeType: INodeType): INodeProperties[]; | ||
export declare function displayParameter(nodeValues: INodeParameters, parameter: INodeProperties | INodeCredentialDescription, nodeValuesRoot?: INodeParameters): boolean; | ||
export declare function displayParameterPath(nodeValues: INodeParameters, parameter: INodeProperties | INodeCredentialDescription, path: string): boolean; | ||
export declare function displayParameter(nodeValues: INodeParameters, parameter: INodeProperties | INodeCredentialDescription, node: INode | null, nodeValuesRoot?: INodeParameters): boolean; | ||
export declare function displayParameterPath(nodeValues: INodeParameters, parameter: INodeProperties | INodeCredentialDescription, path: string, node: INode | null): boolean; | ||
export declare function getContext(runExecutionData: IRunExecutionData, type: string, node?: INode): IContextObject; | ||
export declare function getParamterDependencies(nodePropertiesArray: INodeProperties[]): IParameterDependencies; | ||
export declare function getParamterResolveOrder(nodePropertiesArray: INodeProperties[], parameterDependencies: IParameterDependencies): number[]; | ||
export declare function getNodeParameters(nodePropertiesArray: INodeProperties[], nodeValues: INodeParameters, returnDefaults: boolean, returnNoneDisplayed: boolean, onlySimpleTypes?: boolean, dataIsResolved?: boolean, nodeValuesRoot?: INodeParameters, parentType?: string, parameterDependencies?: IParameterDependencies): INodeParameters | null; | ||
export declare function getNodeParameters(nodePropertiesArray: INodeProperties[], nodeValues: INodeParameters, returnDefaults: boolean, returnNoneDisplayed: boolean, node: INode | null, onlySimpleTypes?: boolean, dataIsResolved?: boolean, nodeValuesRoot?: INodeParameters, parentType?: string, parameterDependencies?: IParameterDependencies): INodeParameters | null; | ||
export declare function prepareOutputData(outputData: INodeExecutionData[], outputIndex?: number): Promise<INodeExecutionData[][]>; | ||
@@ -18,3 +18,3 @@ export declare function getNodeWebhooks(workflow: Workflow, node: INode, additionalData: IWorkflowExecuteAdditionalData, ignoreRestartWehbooks?: boolean): IWebhookData[]; | ||
export declare function getParameterValueByPath(nodeValues: INodeParameters, parameterName: string, path: string): INodeParameters | NodeParameterValue | NodeParameterValue[] | INodeParameters[]; | ||
export declare function getParameterIssues(nodeProperties: INodeProperties, nodeValues: INodeParameters, path: string): INodeIssues; | ||
export declare function getParameterIssues(nodeProperties: INodeProperties, nodeValues: INodeParameters, path: string, node: INode): INodeIssues; | ||
export declare function mergeIssues(destination: INodeIssues, source: INodeIssues | null): void; | ||
@@ -21,0 +21,0 @@ export declare function mergeNodeProperties(mainProperties: INodeProperties[], addProperties: INodeProperties[]): void; |
@@ -210,3 +210,3 @@ "use strict"; | ||
exports.getSpecialNodeParameters = getSpecialNodeParameters; | ||
function displayParameter(nodeValues, parameter, nodeValuesRoot) { | ||
function displayParameter(nodeValues, parameter, node, nodeValuesRoot) { | ||
if (!parameter.displayOptions) { | ||
@@ -223,2 +223,5 @@ return true; | ||
} | ||
else if (propertyName === '@version') { | ||
value = (node === null || node === void 0 ? void 0 : node.typeVersion) || 0; | ||
} | ||
else { | ||
@@ -248,2 +251,5 @@ value = (0, lodash_1.get)(nodeValues, propertyName); | ||
} | ||
else if (propertyName === '@version') { | ||
value = (node === null || node === void 0 ? void 0 : node.typeVersion) || 0; | ||
} | ||
else { | ||
@@ -268,3 +274,3 @@ value = (0, lodash_1.get)(nodeValues, propertyName); | ||
exports.displayParameter = displayParameter; | ||
function displayParameterPath(nodeValues, parameter, path) { | ||
function displayParameterPath(nodeValues, parameter, path, node) { | ||
let resolvedNodeValues = nodeValues; | ||
@@ -278,3 +284,3 @@ if (path !== '') { | ||
} | ||
return displayParameter(resolvedNodeValues, parameter, nodeValuesRoot); | ||
return displayParameter(resolvedNodeValues, parameter, node, nodeValuesRoot); | ||
} | ||
@@ -319,2 +325,5 @@ exports.displayParameterPath = displayParameterPath; | ||
if (!dependencies[nodeProperties.name].includes(parameterName)) { | ||
if (parameterName.charAt(0) === '@') { | ||
continue; | ||
} | ||
dependencies[nodeProperties.name].push(parameterName); | ||
@@ -368,3 +377,3 @@ } | ||
exports.getParamterResolveOrder = getParamterResolveOrder; | ||
function getNodeParameters(nodePropertiesArray, nodeValues, returnDefaults, returnNoneDisplayed, onlySimpleTypes = false, dataIsResolved = false, nodeValuesRoot, parentType, parameterDependencies) { | ||
function getNodeParameters(nodePropertiesArray, nodeValues, returnDefaults, returnNoneDisplayed, node, onlySimpleTypes = false, dataIsResolved = false, nodeValuesRoot, parentType, parameterDependencies) { | ||
if (parameterDependencies === undefined) { | ||
@@ -389,3 +398,3 @@ parameterDependencies = getParamterDependencies(nodePropertiesArray); | ||
if (!dataIsResolved && !returnNoneDisplayed) { | ||
nodeValuesDisplayCheck = getNodeParameters(nodePropertiesArray, nodeValues, true, true, true, true, nodeValuesRoot, parentType, parameterDependencies); | ||
nodeValuesDisplayCheck = getNodeParameters(nodePropertiesArray, nodeValues, true, true, node, true, true, nodeValuesRoot, parentType, parameterDependencies); | ||
} | ||
@@ -401,3 +410,3 @@ nodeValuesRoot = nodeValuesRoot || nodeValuesDisplayCheck; | ||
if (!returnNoneDisplayed && | ||
!displayParameter(nodeValuesDisplayCheck, nodeProperties, nodeValuesRoot)) { | ||
!displayParameter(nodeValuesDisplayCheck, nodeProperties, node, nodeValuesRoot)) { | ||
if (!returnNoneDisplayed || !returnDefaults) { | ||
@@ -409,3 +418,3 @@ continue; | ||
if (duplicateParameterNames.includes(nodeProperties.name)) { | ||
if (!displayParameter(nodeValuesDisplayCheck, nodeProperties, nodeValuesRoot)) { | ||
if (!displayParameter(nodeValuesDisplayCheck, nodeProperties, node, nodeValuesRoot)) { | ||
continue; | ||
@@ -458,3 +467,3 @@ } | ||
else if (nodeValues[nodeProperties.name] !== undefined) { | ||
const tempNodeParameters = getNodeParameters(nodeProperties.options, nodeValues[nodeProperties.name], returnDefaults, returnNoneDisplayed, false, false, nodeValuesRoot, nodeProperties.type); | ||
const tempNodeParameters = getNodeParameters(nodeProperties.options, nodeValues[nodeProperties.name], returnDefaults, returnNoneDisplayed, node, false, false, nodeValuesRoot, nodeProperties.type); | ||
if (tempNodeParameters !== null) { | ||
@@ -491,3 +500,3 @@ nodeParameters[nodeProperties.name] = tempNodeParameters; | ||
tempNodePropertiesArray = nodePropertyOptions.values; | ||
tempValue = getNodeParameters(tempNodePropertiesArray, nodeValue, returnDefaults, returnNoneDisplayed, false, false, nodeValuesRoot, nodeProperties.type); | ||
tempValue = getNodeParameters(tempNodePropertiesArray, nodeValue, returnDefaults, returnNoneDisplayed, node, false, false, nodeValuesRoot, nodeProperties.type); | ||
if (tempValue !== null) { | ||
@@ -504,3 +513,3 @@ tempArrayValue.push(tempValue); | ||
tempNodePropertiesArray = nodePropertyOptions.values; | ||
tempValue = getNodeParameters(tempNodePropertiesArray, nodeValues[nodeProperties.name][itemName], returnDefaults, returnNoneDisplayed, false, false, nodeValuesRoot, nodeProperties.type); | ||
tempValue = getNodeParameters(tempNodePropertiesArray, nodeValues[nodeProperties.name][itemName], returnDefaults, returnNoneDisplayed, node, false, false, nodeValuesRoot, nodeProperties.type); | ||
if (tempValue !== null) { | ||
@@ -630,3 +639,3 @@ Object.assign(tempNodeParameters, tempValue); | ||
for (const nodeProperty of nodePropertiesArray) { | ||
propertyIssues = getParameterIssues(nodeProperty, node.parameters, ''); | ||
propertyIssues = getParameterIssues(nodeProperty, node.parameters, '', node); | ||
mergeIssues(foundIssues, propertyIssues); | ||
@@ -686,7 +695,7 @@ } | ||
exports.getParameterValueByPath = getParameterValueByPath; | ||
function getParameterIssues(nodeProperties, nodeValues, path) { | ||
function getParameterIssues(nodeProperties, nodeValues, path, node) { | ||
const foundIssues = {}; | ||
let value; | ||
if (nodeProperties.required === true) { | ||
if (displayParameterPath(nodeValues, nodeProperties, path)) { | ||
if (displayParameterPath(nodeValues, nodeProperties, path, node)) { | ||
value = getParameterValueByPath(nodeValues, nodeProperties.name, path); | ||
@@ -755,3 +764,3 @@ if (nodeProperties.typeOptions !== undefined && | ||
for (const optionData of checkChildNodeProperties) { | ||
propertyIssues = getParameterIssues(optionData.data, nodeValues, optionData.basePath); | ||
propertyIssues = getParameterIssues(optionData.data, nodeValues, optionData.basePath, node); | ||
mergeIssues(foundIssues, propertyIssues); | ||
@@ -758,0 +767,0 @@ } |
@@ -297,3 +297,3 @@ "use strict"; | ||
let basePath = path ? `${path}.` : ''; | ||
if (!_1.NodeHelpers.displayParameter(this.node.parameters, nodeProperties, this.node.parameters)) { | ||
if (!_1.NodeHelpers.displayParameter(this.node.parameters, nodeProperties, this.node, this.node.parameters)) { | ||
return undefined; | ||
@@ -300,0 +300,0 @@ } |
@@ -18,3 +18,3 @@ "use strict"; | ||
} | ||
const nodeParameters = _1.NodeHelpers.getNodeParameters(nodeType.description.properties, node.parameters, true, false); | ||
const nodeParameters = _1.NodeHelpers.getNodeParameters(nodeType.description.properties, node.parameters, true, false, node); | ||
node.parameters = nodeParameters !== null ? nodeParameters : {}; | ||
@@ -21,0 +21,0 @@ } |
{ | ||
"name": "n8n-workflow", | ||
"version": "0.97.0", | ||
"version": "0.98.0", | ||
"description": "Workflow base code of n8n", | ||
@@ -5,0 +5,0 @@ "license": "SEE LICENSE IN LICENSE.md", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
681061
10607