fix(core): Support helpers.request in task runners (#15859)

This commit is contained in:
Iván Ovejero
2025-05-30 12:37:18 +02:00
committed by GitHub
parent 2a1475d671
commit 7f8b943c1a
2 changed files with 4 additions and 0 deletions

View File

@@ -119,6 +119,9 @@ export const EXPOSED_RPC_METHODS = [
// httpRequest(opts: IHttpRequestOptions): Promise<IN8nHttpFullResponse | IN8nHttpResponse>
'helpers.httpRequest',
// (deprecated) request(uriOrObject: string | IRequestOptions, options?: IRequestOptions): Promise<any>;
'helpers.request',
];
/** Helpers that exist but that we are not exposing to the Code Node */

View File

@@ -30,6 +30,7 @@ describe('TaskRequester', () => {
['helpers.setBinaryDataBuffer', [{ data: '123' }, Buffer.from('data').toJSON()]],
['helpers.binaryToString', [Buffer.from('data').toJSON(), 'utf8']],
['helpers.httpRequest', [{ url: 'http://localhost' }]],
['helpers.request', [{ url: 'http://localhost' }]],
])('should handle %s rpc call', async (methodName, args) => {
const executeFunctions = set({}, methodName.split('.'), jest.fn());