mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
refactor(Code Tool Node): Replace vm2 with taskrunner for js (#19247)
This commit is contained in:
@@ -21,6 +21,8 @@ import type {
|
||||
ISourceData,
|
||||
AiEvent,
|
||||
NodeConnectionType,
|
||||
Result,
|
||||
IExecuteFunctions,
|
||||
} from 'n8n-workflow';
|
||||
import {
|
||||
ApplicationError,
|
||||
@@ -28,6 +30,7 @@ import {
|
||||
NodeConnectionTypes,
|
||||
WAIT_INDEFINITELY,
|
||||
WorkflowDataProxy,
|
||||
createEnvProviderState,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import { BinaryDataService } from '@/binary-data/binary-data.service';
|
||||
@@ -229,4 +232,29 @@ export class BaseExecuteContext extends NodeExecutionContext {
|
||||
msg,
|
||||
});
|
||||
}
|
||||
|
||||
async startJob<T = unknown, E = unknown>(
|
||||
jobType: string,
|
||||
settings: unknown,
|
||||
itemIndex: number,
|
||||
): Promise<Result<T, E>> {
|
||||
return await this.additionalData.startRunnerTask<T, E>(
|
||||
this.additionalData,
|
||||
jobType,
|
||||
settings,
|
||||
this as IExecuteFunctions,
|
||||
this.inputData,
|
||||
this.node,
|
||||
this.workflow,
|
||||
this.runExecutionData,
|
||||
this.runIndex,
|
||||
itemIndex,
|
||||
this.node.name,
|
||||
this.connectionInputData,
|
||||
{},
|
||||
this.mode,
|
||||
createEnvProviderState(),
|
||||
this.executeData,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@ import type {
|
||||
ITaskDataConnections,
|
||||
IWorkflowExecuteAdditionalData,
|
||||
NodeExecutionHint,
|
||||
Result,
|
||||
StructuredChunk,
|
||||
Workflow,
|
||||
WorkflowExecuteMode,
|
||||
@@ -22,7 +21,6 @@ import type {
|
||||
import {
|
||||
ApplicationError,
|
||||
createDeferredPromise,
|
||||
createEnvProviderState,
|
||||
jsonParse,
|
||||
NodeConnectionTypes,
|
||||
} from 'n8n-workflow';
|
||||
@@ -173,31 +171,6 @@ export class ExecuteContext extends BaseExecuteContext implements IExecuteFuncti
|
||||
await this.additionalData.hooks?.runHook('sendChunk', [message]);
|
||||
}
|
||||
|
||||
async startJob<T = unknown, E = unknown>(
|
||||
jobType: string,
|
||||
settings: unknown,
|
||||
itemIndex: number,
|
||||
): Promise<Result<T, E>> {
|
||||
return await this.additionalData.startRunnerTask<T, E>(
|
||||
this.additionalData,
|
||||
jobType,
|
||||
settings,
|
||||
this,
|
||||
this.inputData,
|
||||
this.node,
|
||||
this.workflow,
|
||||
this.runExecutionData,
|
||||
this.runIndex,
|
||||
itemIndex,
|
||||
this.node.name,
|
||||
this.connectionInputData,
|
||||
{},
|
||||
this.mode,
|
||||
createEnvProviderState(),
|
||||
this.executeData,
|
||||
);
|
||||
}
|
||||
|
||||
async getInputConnectionData(
|
||||
connectionType: AINodeConnectionType,
|
||||
itemIndex: number,
|
||||
|
||||
Reference in New Issue
Block a user