mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
fix(core): Setup nodeHelpers that aren't exposed in the code sandbox (no-changelog) (#5753)
This commit is contained in:
committed by
GitHub
parent
d3a34ab71b
commit
b0cfd69f2b
@@ -49,6 +49,7 @@ import type {
|
||||
IPairedItemData,
|
||||
ICredentialTestFunctions,
|
||||
BinaryHelperFunctions,
|
||||
NodeHelperFunctions,
|
||||
RequestHelperFunctions,
|
||||
FunctionsBase,
|
||||
IExecuteFunctions,
|
||||
@@ -2054,6 +2055,13 @@ const getFileSystemHelperFunctions = (node: INode): FileSystemHelperFunctions =>
|
||||
},
|
||||
});
|
||||
|
||||
const getNodeHelperFunctions = ({
|
||||
executionId,
|
||||
}: IWorkflowExecuteAdditionalData): NodeHelperFunctions => ({
|
||||
copyBinaryFile: async (filePath, fileName, mimeType) =>
|
||||
copyBinaryFile(executionId!, filePath, fileName, mimeType),
|
||||
});
|
||||
|
||||
const getBinaryHelperFunctions = ({
|
||||
executionId,
|
||||
}: IWorkflowExecuteAdditionalData): BinaryHelperFunctions => ({
|
||||
@@ -2064,8 +2072,9 @@ const getBinaryHelperFunctions = ({
|
||||
prepareBinaryData(binaryData, executionId!, filePath, mimeType),
|
||||
setBinaryDataBuffer: async (data, binaryData) =>
|
||||
setBinaryDataBuffer(data, binaryData, executionId!),
|
||||
copyBinaryFile: async (filePath, fileName, mimeType) =>
|
||||
copyBinaryFile(executionId!, filePath, fileName, mimeType),
|
||||
copyBinaryFile: async () => {
|
||||
throw new Error('copyBinaryFile has been removed. Please upgrade this node');
|
||||
},
|
||||
});
|
||||
|
||||
/**
|
||||
@@ -2368,6 +2377,7 @@ export function getExecuteFunctions(
|
||||
normalizeItems,
|
||||
constructExecutionMetaData,
|
||||
},
|
||||
nodeHelpers: getNodeHelperFunctions(additionalData),
|
||||
};
|
||||
})(workflow, runExecutionData, connectionInputData, inputData, node) as IExecuteFunctions;
|
||||
}
|
||||
@@ -2758,6 +2768,7 @@ export function getExecuteWebhookFunctions(
|
||||
...getBinaryHelperFunctions(additionalData),
|
||||
returnJsonArray,
|
||||
},
|
||||
nodeHelpers: getNodeHelperFunctions(additionalData),
|
||||
};
|
||||
})(workflow, node);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user