mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
fix(Code Node): Bind helper methods to the correct context (#9380)
This commit is contained in:
committed by
GitHub
parent
97d3c6465c
commit
82c8801f25
@@ -19,11 +19,16 @@ export interface SandboxContext extends IWorkflowDataProxyData {
|
||||
export const REQUIRED_N8N_ITEM_KEYS = new Set(['json', 'binary', 'pairedItem', 'error']);
|
||||
|
||||
export function getSandboxContext(this: IExecuteFunctions, index: number): SandboxContext {
|
||||
const helpers = {
|
||||
...this.helpers,
|
||||
httpRequestWithAuthentication: this.helpers.httpRequestWithAuthentication.bind(this),
|
||||
requestWithAuthenticationPaginated: this.helpers.requestWithAuthenticationPaginated.bind(this),
|
||||
};
|
||||
return {
|
||||
// from NodeExecuteFunctions
|
||||
$getNodeParameter: this.getNodeParameter,
|
||||
$getWorkflowStaticData: this.getWorkflowStaticData,
|
||||
helpers: this.helpers,
|
||||
helpers,
|
||||
|
||||
// to bring in all $-prefixed vars and methods from WorkflowDataProxy
|
||||
// $node, $items(), $parameter, $json, $env, etc.
|
||||
|
||||
Reference in New Issue
Block a user