mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2026-07-24 22:00:50 +02:00
refactor(core): Move final batch of entities to @n8n/db (#15061)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import type { MockedNodeItem, TestDefinition } from '@n8n/db';
|
||||
import { Service } from '@n8n/di';
|
||||
|
||||
import type { MockedNodeItem, TestDefinition } from '@/databases/entities/test-definition.ee';
|
||||
import { AnnotationTagRepository } from '@/databases/repositories/annotation-tag.repository.ee';
|
||||
import { TestDefinitionRepository } from '@/databases/repositories/test-definition.repository.ee';
|
||||
import { BadRequestError } from '@/errors/response-errors/bad-request.error';
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import type { MockedNodeItem } from '@/databases/entities/test-definition.ee';
|
||||
import type { MockedNodeItem } from '@n8n/db';
|
||||
|
||||
import type { AuthenticatedRequest, ListQuery } from '@/requests';
|
||||
|
||||
// ----------------------------------
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
import type { TestCaseExecution } from '@n8n/db';
|
||||
import { mock } from 'jest-mock-extended';
|
||||
|
||||
import type { TestCaseExecution } from '@/databases/entities/test-case-execution.ee';
|
||||
import { getTestRunFinalResult } from '@/evaluation.ee/test-runner/utils.ee';
|
||||
|
||||
function mockTestCaseExecutions(statuses: Array<TestCaseExecution['status']>) {
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
import type { User } from '@n8n/db';
|
||||
import type { ExecutionEntity } from '@n8n/db';
|
||||
import type { TestDefinition } from '@n8n/db';
|
||||
import type { TestMetric } from '@n8n/db';
|
||||
import type { TestRun } from '@n8n/db';
|
||||
import type { SelectQueryBuilder } from '@n8n/typeorm';
|
||||
import { stringify } from 'flatted';
|
||||
import { readFileSync } from 'fs';
|
||||
import { mock, mockDeep } from 'jest-mock-extended';
|
||||
import type { ErrorReporter } from 'n8n-core';
|
||||
import type { ExecutionError, GenericValue, IRun } from 'n8n-workflow';
|
||||
import type { ITaskData } from 'n8n-workflow';
|
||||
import type { ExecutionError, GenericValue, IRun } from 'n8n-workflow';
|
||||
import path from 'path';
|
||||
|
||||
import type { ActiveExecutions } from '@/active-executions';
|
||||
import config from '@/config';
|
||||
import type { ExecutionEntity } from '@/databases/entities/execution-entity';
|
||||
import type { TestDefinition } from '@/databases/entities/test-definition.ee';
|
||||
import type { TestMetric } from '@/databases/entities/test-metric.ee';
|
||||
import type { TestRun } from '@/databases/entities/test-run.ee';
|
||||
import type { ExecutionRepository } from '@/databases/repositories/execution.repository';
|
||||
import type { TestCaseExecutionRepository } from '@/databases/repositories/test-case-execution.repository.ee';
|
||||
import type { TestMetricRepository } from '@/databases/repositories/test-metric.repository.ee';
|
||||
|
||||
@@ -1,15 +1,6 @@
|
||||
import type { TestCaseExecutionErrorCode, TestRunErrorCode } from '@n8n/db';
|
||||
import { UnexpectedError } from 'n8n-workflow';
|
||||
|
||||
export type TestCaseExecutionErrorCode =
|
||||
| 'MOCKED_NODE_DOES_NOT_EXIST'
|
||||
| 'TRIGGER_NO_LONGER_EXISTS'
|
||||
| 'FAILED_TO_EXECUTE_WORKFLOW'
|
||||
| 'EVALUATION_WORKFLOW_DOES_NOT_EXIST'
|
||||
| 'FAILED_TO_EXECUTE_EVALUATION_WORKFLOW'
|
||||
| 'INVALID_METRICS'
|
||||
| 'PAYLOAD_LIMIT_EXCEEDED'
|
||||
| 'UNKNOWN_ERROR';
|
||||
|
||||
export class TestCaseExecutionError extends UnexpectedError {
|
||||
readonly code: TestCaseExecutionErrorCode;
|
||||
|
||||
@@ -20,12 +11,6 @@ export class TestCaseExecutionError extends UnexpectedError {
|
||||
}
|
||||
}
|
||||
|
||||
export type TestRunErrorCode =
|
||||
| 'PAST_EXECUTIONS_NOT_FOUND'
|
||||
| 'EVALUATION_WORKFLOW_NOT_FOUND'
|
||||
| 'INTERRUPTED'
|
||||
| 'UNKNOWN_ERROR';
|
||||
|
||||
export class TestRunError extends UnexpectedError {
|
||||
readonly code: TestRunErrorCode;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { User } from '@n8n/db';
|
||||
import type { User, ExecutionEntity, MockedNodeItem, TestDefinition, TestRun } from '@n8n/db';
|
||||
import { Service } from '@n8n/di';
|
||||
import { parse } from 'flatted';
|
||||
import difference from 'lodash/difference';
|
||||
@@ -17,9 +17,6 @@ import assert from 'node:assert';
|
||||
import { ActiveExecutions } from '@/active-executions';
|
||||
import config from '@/config';
|
||||
import { EVALUATION_METRICS_NODE } from '@/constants';
|
||||
import type { ExecutionEntity } from '@/databases/entities/execution-entity';
|
||||
import type { MockedNodeItem, TestDefinition } from '@/databases/entities/test-definition.ee';
|
||||
import type { TestRun } from '@/databases/entities/test-run.ee';
|
||||
import { ExecutionRepository } from '@/databases/repositories/execution.repository';
|
||||
import { TestCaseExecutionRepository } from '@/databases/repositories/test-case-execution.repository.ee';
|
||||
import { TestMetricRepository } from '@/databases/repositories/test-metric.repository.ee';
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import type { TestCaseExecution, MockedNodeItem, TestRunFinalResult } from '@n8n/db';
|
||||
import assert from 'assert';
|
||||
import { mapValues, pick } from 'lodash';
|
||||
import type {
|
||||
@@ -9,9 +10,6 @@ import type {
|
||||
INode,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import type { TestCaseExecution } from '@/databases/entities/test-case-execution.ee';
|
||||
import type { MockedNodeItem } from '@/databases/entities/test-definition.ee';
|
||||
import type { TestRunFinalResult } from '@/databases/repositories/test-run.repository.ee';
|
||||
import { TestCaseExecutionError } from '@/evaluation.ee/test-runner/errors.ee';
|
||||
import type { TestCaseRunMetadata } from '@/evaluation.ee/test-runner/test-runner.service.ee';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user