mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
fix(resource locator): add back extract value logic (#4178)
add back extract value logic
This commit is contained in:
@@ -59,6 +59,7 @@ import {
|
||||
LoggerProxy as Logger,
|
||||
IExecuteData,
|
||||
OAuth2GrantType,
|
||||
IGetNodeParameterOptions,
|
||||
NodeParameterValueType,
|
||||
NodeExecutionWithMetadata,
|
||||
IPairedItemData,
|
||||
@@ -99,6 +100,7 @@ import {
|
||||
IWorkflowSettings,
|
||||
PLACEHOLDER_EMPTY_EXECUTION_ID,
|
||||
} from '.';
|
||||
import { extractValue } from './ExtractValue';
|
||||
|
||||
axios.defaults.timeout = 300000;
|
||||
// Prevent axios from adding x-form-www-urlencoded headers by default
|
||||
@@ -1725,6 +1727,7 @@ export function getNodeParameter(
|
||||
additionalKeys: IWorkflowDataProxyAdditionalKeys,
|
||||
executeData?: IExecuteData,
|
||||
fallbackValue?: any,
|
||||
options?: IGetNodeParameterOptions,
|
||||
): NodeParameterValueType | object {
|
||||
const nodeType = workflow.nodeTypes.getByNameAndVersion(node.type, node.typeVersion);
|
||||
if (nodeType === undefined) {
|
||||
@@ -1759,6 +1762,11 @@ export function getNodeParameter(
|
||||
throw e;
|
||||
}
|
||||
|
||||
// This is outside the try/catch because it throws errors with proper messages
|
||||
if (options?.extractValue) {
|
||||
returnData = extractValue(returnData, parameterName, node, nodeType);
|
||||
}
|
||||
|
||||
return returnData;
|
||||
}
|
||||
|
||||
@@ -1931,6 +1939,7 @@ export function getExecutePollFunctions(
|
||||
getNodeParameter: (
|
||||
parameterName: string,
|
||||
fallbackValue?: any,
|
||||
options?: IGetNodeParameterOptions,
|
||||
): NodeParameterValueType | object => {
|
||||
const runExecutionData: IRunExecutionData | null = null;
|
||||
const itemIndex = 0;
|
||||
@@ -1950,6 +1959,7 @@ export function getExecutePollFunctions(
|
||||
getAdditionalKeys(additionalData),
|
||||
undefined,
|
||||
fallbackValue,
|
||||
options,
|
||||
);
|
||||
},
|
||||
getRestApiUrl: (): string => {
|
||||
@@ -2084,6 +2094,7 @@ export function getExecuteTriggerFunctions(
|
||||
getNodeParameter: (
|
||||
parameterName: string,
|
||||
fallbackValue?: any,
|
||||
options?: IGetNodeParameterOptions,
|
||||
): NodeParameterValueType | object => {
|
||||
const runExecutionData: IRunExecutionData | null = null;
|
||||
const itemIndex = 0;
|
||||
@@ -2103,6 +2114,7 @@ export function getExecuteTriggerFunctions(
|
||||
getAdditionalKeys(additionalData),
|
||||
undefined,
|
||||
fallbackValue,
|
||||
options,
|
||||
);
|
||||
},
|
||||
getRestApiUrl: (): string => {
|
||||
@@ -2302,6 +2314,7 @@ export function getExecuteFunctions(
|
||||
parameterName: string,
|
||||
itemIndex: number,
|
||||
fallbackValue?: any,
|
||||
options?: IGetNodeParameterOptions,
|
||||
): NodeParameterValueType | object => {
|
||||
return getNodeParameter(
|
||||
workflow,
|
||||
@@ -2316,6 +2329,7 @@ export function getExecuteFunctions(
|
||||
getAdditionalKeys(additionalData),
|
||||
executeData,
|
||||
fallbackValue,
|
||||
options,
|
||||
);
|
||||
},
|
||||
getMode: (): WorkflowExecuteMode => {
|
||||
@@ -2575,6 +2589,7 @@ export function getExecuteSingleFunctions(
|
||||
getNodeParameter: (
|
||||
parameterName: string,
|
||||
fallbackValue?: any,
|
||||
options?: IGetNodeParameterOptions,
|
||||
): NodeParameterValueType | object => {
|
||||
return getNodeParameter(
|
||||
workflow,
|
||||
@@ -2589,6 +2604,7 @@ export function getExecuteSingleFunctions(
|
||||
getAdditionalKeys(additionalData),
|
||||
executeData,
|
||||
fallbackValue,
|
||||
options,
|
||||
);
|
||||
},
|
||||
getWorkflow: () => {
|
||||
@@ -2742,6 +2758,7 @@ export function getLoadOptionsFunctions(
|
||||
getNodeParameter: (
|
||||
parameterName: string,
|
||||
fallbackValue?: any,
|
||||
options?: IGetNodeParameterOptions,
|
||||
): NodeParameterValueType | object => {
|
||||
const runExecutionData: IRunExecutionData | null = null;
|
||||
const itemIndex = 0;
|
||||
@@ -2761,6 +2778,7 @@ export function getLoadOptionsFunctions(
|
||||
getAdditionalKeys(additionalData),
|
||||
undefined,
|
||||
fallbackValue,
|
||||
options,
|
||||
);
|
||||
},
|
||||
getTimezone: (): string => {
|
||||
@@ -2868,6 +2886,7 @@ export function getExecuteHookFunctions(
|
||||
getNodeParameter: (
|
||||
parameterName: string,
|
||||
fallbackValue?: any,
|
||||
options?: IGetNodeParameterOptions,
|
||||
): NodeParameterValueType | object => {
|
||||
const runExecutionData: IRunExecutionData | null = null;
|
||||
const itemIndex = 0;
|
||||
@@ -2887,6 +2906,7 @@ export function getExecuteHookFunctions(
|
||||
getAdditionalKeys(additionalData),
|
||||
undefined,
|
||||
fallbackValue,
|
||||
options,
|
||||
);
|
||||
},
|
||||
getNodeWebhookUrl: (name: string): string | undefined => {
|
||||
@@ -3026,6 +3046,7 @@ export function getExecuteWebhookFunctions(
|
||||
getNodeParameter: (
|
||||
parameterName: string,
|
||||
fallbackValue?: any,
|
||||
options?: IGetNodeParameterOptions,
|
||||
): NodeParameterValueType | object => {
|
||||
const runExecutionData: IRunExecutionData | null = null;
|
||||
const itemIndex = 0;
|
||||
@@ -3045,6 +3066,7 @@ export function getExecuteWebhookFunctions(
|
||||
getAdditionalKeys(additionalData),
|
||||
undefined,
|
||||
fallbackValue,
|
||||
options,
|
||||
);
|
||||
},
|
||||
getParamsData(): object {
|
||||
|
||||
Reference in New Issue
Block a user