refactor: Move js task runner into own directory (#11146)

This commit is contained in:
Tomi Turtiainen 2024-10-08 12:24:10 +03:00 committed by GitHub
parent 1ded08bf7e
commit 51606cb279
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 13 additions and 9 deletions

View file

@ -1,8 +1,12 @@
import type { CodeExecutionMode, IDataObject, WorkflowExecuteMode } from 'n8n-workflow';
import { JsTaskRunner, type AllCodeTaskData, type JSExecSettings } from '@/code';
import { ValidationError } from '@/js-task-runner/errors/validation-error';
import {
JsTaskRunner,
type AllCodeTaskData,
type JSExecSettings,
} from '@/js-task-runner/js-task-runner';
import type { Task } from '@/task-runner';
import { ValidationError } from '@/validation-error';
import { newAllCodeTaskData, newTaskWithSettings, withPairedItem, wrapIntoJson } from './test-data';

View file

@ -2,7 +2,7 @@ import type { IDataObject, INode, INodeExecutionData, ITaskData } from 'n8n-work
import { NodeConnectionType } from 'n8n-workflow';
import { nanoid } from 'nanoid';
import type { AllCodeTaskData, JSExecSettings } from '@/code';
import type { AllCodeTaskData, JSExecSettings } from '@/js-task-runner/js-task-runner';
import type { Task } from '@/task-runner';
/**

View file

@ -21,10 +21,10 @@ import type {
import * as a from 'node:assert';
import { runInNewContext, type Context } from 'node:vm';
import { validateRunForAllItemsOutput, validateRunForEachItemOutput } from '@/result-validation';
import type { TaskResultData } from '@/runner-types';
import { type Task, TaskRunner } from '@/task-runner';
import type { TaskResultData } from './runner-types';
import { type Task, TaskRunner } from './task-runner';
import { validateRunForAllItemsOutput, validateRunForEachItemOutput } from './result-validation';
export interface JSExecSettings {
code: string;

View file

@ -1,8 +1,8 @@
import { normalizeItems } from 'n8n-core';
import type { INodeExecutionData } from 'n8n-workflow';
import { isObject } from '@/obj-utils';
import { ValidationError } from '@/validation-error';
import { ValidationError } from './errors/validation-error';
import { isObject } from './obj-utils';
export const REQUIRED_N8N_ITEM_KEYS = new Set(['json', 'binary', 'pairedItem', 'error']);

View file

@ -2,7 +2,7 @@ import { ApplicationError, ensureError } from 'n8n-workflow';
import * as a from 'node:assert/strict';
import { authenticate } from './authenticator';
import { JsTaskRunner } from './code';
import { JsTaskRunner } from './js-task-runner/js-task-runner';
let runner: JsTaskRunner | undefined;
let isShuttingDown = false;