mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-24 20:24:05 -08:00
fix(Code Node): Bind helper methods to the correct context (#9380)
This commit is contained in:
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.
|
||||
|
|
Loading…
Reference in a new issue