n8n-workflow
Advanced tools
Comparing version 0.57.0 to 0.58.0
@@ -6,3 +6,3 @@ import { INode, INodeExecutionData, INodeParameters, IRunExecutionData, NodeParameterValue, Workflow, WorkflowExecuteMode } from './'; | ||
convertObjectValueToString(value: object): string; | ||
resolveSimpleParameterValue(parameterValue: NodeParameterValue, runExecutionData: IRunExecutionData | null, runIndex: number, itemIndex: number, activeNodeName: string, connectionInputData: INodeExecutionData[], mode: WorkflowExecuteMode, returnObjectAsString?: boolean, selfData?: {}): NodeParameterValue | INodeParameters | NodeParameterValue[] | INodeParameters[]; | ||
resolveSimpleParameterValue(parameterValue: NodeParameterValue, siblingParameters: INodeParameters, runExecutionData: IRunExecutionData | null, runIndex: number, itemIndex: number, activeNodeName: string, connectionInputData: INodeExecutionData[], mode: WorkflowExecuteMode, returnObjectAsString?: boolean, selfData?: {}): NodeParameterValue | INodeParameters | NodeParameterValue[] | INodeParameters[]; | ||
getSimpleParameterValue(node: INode, parameterValue: string | boolean | undefined, mode: WorkflowExecuteMode, defaultValue?: boolean | number | string): boolean | number | string | undefined; | ||
@@ -9,0 +9,0 @@ getComplexParameterValue(node: INode, parameterValue: NodeParameterValue | INodeParameters | NodeParameterValue[] | INodeParameters[], mode: WorkflowExecuteMode, defaultValue?: NodeParameterValue | INodeParameters | NodeParameterValue[] | INodeParameters[] | undefined, selfData?: {}): NodeParameterValue | INodeParameters | NodeParameterValue[] | INodeParameters[] | undefined; |
@@ -16,3 +16,3 @@ "use strict"; | ||
} | ||
resolveSimpleParameterValue(parameterValue, runExecutionData, runIndex, itemIndex, activeNodeName, connectionInputData, mode, returnObjectAsString = false, selfData = {}) { | ||
resolveSimpleParameterValue(parameterValue, siblingParameters, runExecutionData, runIndex, itemIndex, activeNodeName, connectionInputData, mode, returnObjectAsString = false, selfData = {}) { | ||
if (typeof parameterValue !== 'string' || parameterValue.charAt(0) !== '=') { | ||
@@ -22,3 +22,3 @@ return parameterValue; | ||
parameterValue = parameterValue.substr(1); | ||
const dataProxy = new _1.WorkflowDataProxy(this.workflow, runExecutionData, runIndex, itemIndex, activeNodeName, connectionInputData, mode, -1, selfData); | ||
const dataProxy = new _1.WorkflowDataProxy(this.workflow, runExecutionData, runIndex, itemIndex, activeNodeName, connectionInputData, siblingParameters, mode, -1, selfData); | ||
const data = dataProxy.getDataProxy(); | ||
@@ -74,3 +74,3 @@ try { | ||
}; | ||
const resolveParameterValue = (value) => { | ||
const resolveParameterValue = (value, siblingParameters) => { | ||
if (isComplexParameter(value)) { | ||
@@ -80,7 +80,7 @@ return this.getParameterValue(value, runExecutionData, runIndex, itemIndex, activeNodeName, connectionInputData, mode, returnObjectAsString, selfData); | ||
else { | ||
return this.resolveSimpleParameterValue(value, runExecutionData, runIndex, itemIndex, activeNodeName, connectionInputData, mode, returnObjectAsString, selfData); | ||
return this.resolveSimpleParameterValue(value, siblingParameters, runExecutionData, runIndex, itemIndex, activeNodeName, connectionInputData, mode, returnObjectAsString, selfData); | ||
} | ||
}; | ||
if (!isComplexParameter(parameterValue)) { | ||
return this.resolveSimpleParameterValue(parameterValue, runExecutionData, runIndex, itemIndex, activeNodeName, connectionInputData, mode, returnObjectAsString, selfData); | ||
return this.resolveSimpleParameterValue(parameterValue, {}, runExecutionData, runIndex, itemIndex, activeNodeName, connectionInputData, mode, returnObjectAsString, selfData); | ||
} | ||
@@ -90,3 +90,3 @@ if (Array.isArray(parameterValue)) { | ||
for (const item of parameterValue) { | ||
returnData.push(resolveParameterValue(item)); | ||
returnData.push(resolveParameterValue(item, {})); | ||
} | ||
@@ -104,3 +104,3 @@ if (returnObjectAsString === true && typeof returnData === 'object') { | ||
for (const key of Object.keys(parameterValue)) { | ||
returnData[key] = resolveParameterValue(parameterValue[key]); | ||
returnData[key] = resolveParameterValue(parameterValue[key], parameterValue); | ||
} | ||
@@ -107,0 +107,0 @@ if (returnObjectAsString === true && typeof returnData === 'object') { |
@@ -251,2 +251,5 @@ "use strict"; | ||
} | ||
if (values.some(v => (typeof v) === 'string' && v.charAt(0) === '=')) { | ||
return true; | ||
} | ||
if (values.length === 0 || !parameter.displayOptions.show[propertyName].some(v => values.includes(v))) { | ||
@@ -253,0 +256,0 @@ return false; |
@@ -1,2 +0,2 @@ | ||
import { INodeExecutionData, IRunExecutionData, IWorkflowDataProxyData, Workflow, WorkflowExecuteMode } from './'; | ||
import { INodeExecutionData, INodeParameters, IRunExecutionData, IWorkflowDataProxyData, Workflow, WorkflowExecuteMode } from './'; | ||
export declare class WorkflowDataProxy { | ||
@@ -10,5 +10,6 @@ private workflow; | ||
private connectionInputData; | ||
private siblingParameters; | ||
private mode; | ||
private selfData; | ||
constructor(workflow: Workflow, runExecutionData: IRunExecutionData | null, runIndex: number, itemIndex: number, activeNodeName: string, connectionInputData: INodeExecutionData[], mode: WorkflowExecuteMode, defaultReturnRunIndex?: number, selfData?: {}); | ||
constructor(workflow: Workflow, runExecutionData: IRunExecutionData | null, runIndex: number, itemIndex: number, activeNodeName: string, connectionInputData: INodeExecutionData[], siblingParameters: INodeParameters, mode: WorkflowExecuteMode, defaultReturnRunIndex?: number, selfData?: {}); | ||
private nodeContextGetter; | ||
@@ -15,0 +16,0 @@ private selfGetter; |
@@ -6,3 +6,3 @@ "use strict"; | ||
class WorkflowDataProxy { | ||
constructor(workflow, runExecutionData, runIndex, itemIndex, activeNodeName, connectionInputData, mode, defaultReturnRunIndex = -1, selfData = {}) { | ||
constructor(workflow, runExecutionData, runIndex, itemIndex, activeNodeName, connectionInputData, siblingParameters, mode, defaultReturnRunIndex = -1, selfData = {}) { | ||
this.workflow = workflow; | ||
@@ -15,2 +15,3 @@ this.runExecutionData = runExecutionData; | ||
this.connectionInputData = connectionInputData; | ||
this.siblingParameters = siblingParameters; | ||
this.mode = mode; | ||
@@ -60,6 +61,16 @@ this.selfData = selfData; | ||
name = name.toString(); | ||
if (!node.parameters.hasOwnProperty(name)) { | ||
throw new Error(`Could not find parameter "${name}" on node "${nodeName}"`); | ||
let returnValue; | ||
if (name[0] === '&') { | ||
const key = name.slice(1); | ||
if (!that.siblingParameters.hasOwnProperty(key)) { | ||
throw new Error(`Could not find sibling parameter "${key}" on node "${nodeName}"`); | ||
} | ||
returnValue = that.siblingParameters[key]; | ||
} | ||
const returnValue = node.parameters[name]; | ||
else { | ||
if (!node.parameters.hasOwnProperty(name)) { | ||
throw new Error(`Could not find parameter "${name}" on node "${nodeName}"`); | ||
} | ||
returnValue = node.parameters[name]; | ||
} | ||
if (typeof returnValue === 'string' && returnValue.charAt(0) === '=') { | ||
@@ -205,3 +216,3 @@ return that.workflow.expression.getParameterValue(returnValue, that.runExecutionData, that.runIndex, that.itemIndex, that.activeNodeName, that.connectionInputData, that.mode); | ||
const defaultReturnRunIndex = runIndex === undefined ? -1 : runIndex; | ||
const dataProxy = new WorkflowDataProxy(this.workflow, this.runExecutionData, this.runIndex, itemIndex, this.activeNodeName, this.connectionInputData, that.mode, defaultReturnRunIndex); | ||
const dataProxy = new WorkflowDataProxy(this.workflow, this.runExecutionData, this.runIndex, itemIndex, this.activeNodeName, this.connectionInputData, that.siblingParameters, that.mode, defaultReturnRunIndex); | ||
return dataProxy.getDataProxy(); | ||
@@ -208,0 +219,0 @@ }, |
{ | ||
"name": "n8n-workflow", | ||
"version": "0.57.0", | ||
"version": "0.58.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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
450700
7151