diff --git a/packages/cli/.eslintrc.js b/packages/cli/.eslintrc.js index a3a1e612ab..6002da5caa 100644 --- a/packages/cli/.eslintrc.js +++ b/packages/cli/.eslintrc.js @@ -71,5 +71,11 @@ module.exports = { ], }, }, + { + files: ['./test/**/*.ts', './src/**/__tests__/**/*.ts'], + rules: { + 'n8n-local-rules/no-dynamic-import-template': 'off', + }, + }, ], }; diff --git a/packages/cli/src/controllers/annotation-tags.controller.ts b/packages/cli/src/controllers/annotation-tags.controller.ee.ts similarity index 99% rename from packages/cli/src/controllers/annotation-tags.controller.ts rename to packages/cli/src/controllers/annotation-tags.controller.ee.ts index ff43c2ef7e..ed6ff8c52a 100644 --- a/packages/cli/src/controllers/annotation-tags.controller.ts +++ b/packages/cli/src/controllers/annotation-tags.controller.ee.ts @@ -1,6 +1,6 @@ import { Delete, Get, Patch, Post, RestController, GlobalScope } from '@/decorators'; import { AnnotationTagsRequest } from '@/requests'; -import { AnnotationTagService } from '@/services/annotation-tag.service'; +import { AnnotationTagService } from '@/services/annotation-tag.service.ee'; @RestController('/annotation-tags') export class AnnotationTagsController { diff --git a/packages/cli/src/databases/entities/annotation-tag-entity.ts b/packages/cli/src/databases/entities/annotation-tag-entity.ee.ts similarity index 93% rename from packages/cli/src/databases/entities/annotation-tag-entity.ts rename to packages/cli/src/databases/entities/annotation-tag-entity.ee.ts index e89c75a5a8..4aed8df8af 100644 --- a/packages/cli/src/databases/entities/annotation-tag-entity.ts +++ b/packages/cli/src/databases/entities/annotation-tag-entity.ee.ts @@ -1,8 +1,8 @@ import { Column, Entity, Index, ManyToMany, OneToMany } from '@n8n/typeorm'; import { IsString, Length } from 'class-validator'; -import type { AnnotationTagMapping } from '@/databases/entities/annotation-tag-mapping'; -import type { ExecutionAnnotation } from '@/databases/entities/execution-annotation'; +import type { AnnotationTagMapping } from '@/databases/entities/annotation-tag-mapping.ee'; +import type { ExecutionAnnotation } from '@/databases/entities/execution-annotation.ee'; import { WithTimestampsAndStringId } from './abstract-entity'; diff --git a/packages/cli/src/databases/entities/annotation-tag-mapping.ts b/packages/cli/src/databases/entities/annotation-tag-mapping.ee.ts similarity index 98% rename from packages/cli/src/databases/entities/annotation-tag-mapping.ts rename to packages/cli/src/databases/entities/annotation-tag-mapping.ee.ts index 2fa4fc79c1..5b1b9e1bf2 100644 --- a/packages/cli/src/databases/entities/annotation-tag-mapping.ts +++ b/packages/cli/src/databases/entities/annotation-tag-mapping.ee.ts @@ -1,7 +1,7 @@ import { Entity, JoinColumn, ManyToOne, PrimaryColumn } from '@n8n/typeorm'; -import type { AnnotationTagEntity } from './annotation-tag-entity'; -import type { ExecutionAnnotation } from './execution-annotation'; +import type { AnnotationTagEntity } from './annotation-tag-entity.ee'; +import type { ExecutionAnnotation } from './execution-annotation.ee'; /** * This entity represents the junction table between the execution annotations and the tags diff --git a/packages/cli/src/databases/entities/execution-annotation.ts b/packages/cli/src/databases/entities/execution-annotation.ee.ts similarity index 98% rename from packages/cli/src/databases/entities/execution-annotation.ts rename to packages/cli/src/databases/entities/execution-annotation.ee.ts index 33943f6330..59820c83b5 100644 --- a/packages/cli/src/databases/entities/execution-annotation.ts +++ b/packages/cli/src/databases/entities/execution-annotation.ee.ts @@ -12,8 +12,8 @@ import { } from '@n8n/typeorm'; import type { AnnotationVote } from 'n8n-workflow'; -import type { AnnotationTagEntity } from './annotation-tag-entity'; -import type { AnnotationTagMapping } from './annotation-tag-mapping'; +import type { AnnotationTagEntity } from './annotation-tag-entity.ee'; +import type { AnnotationTagMapping } from './annotation-tag-mapping.ee'; import { ExecutionEntity } from './execution-entity'; @Entity({ name: 'execution_annotations' }) diff --git a/packages/cli/src/databases/entities/execution-entity.ts b/packages/cli/src/databases/entities/execution-entity.ts index d44cb6c3f0..f481bb97f4 100644 --- a/packages/cli/src/databases/entities/execution-entity.ts +++ b/packages/cli/src/databases/entities/execution-entity.ts @@ -12,7 +12,7 @@ import { } from '@n8n/typeorm'; import { ExecutionStatus, WorkflowExecuteMode } from 'n8n-workflow'; -import type { ExecutionAnnotation } from '@/databases/entities/execution-annotation'; +import type { ExecutionAnnotation } from '@/databases/entities/execution-annotation.ee'; import { datetimeColumnType } from './abstract-entity'; import type { ExecutionData } from './execution-data'; diff --git a/packages/cli/src/databases/entities/index.ts b/packages/cli/src/databases/entities/index.ts index 8ae29ababd..383ad4084d 100644 --- a/packages/cli/src/databases/entities/index.ts +++ b/packages/cli/src/databases/entities/index.ts @@ -1,11 +1,11 @@ -import { AnnotationTagEntity } from './annotation-tag-entity'; -import { AnnotationTagMapping } from './annotation-tag-mapping'; +import { AnnotationTagEntity } from './annotation-tag-entity.ee'; +import { AnnotationTagMapping } from './annotation-tag-mapping.ee'; import { AuthIdentity } from './auth-identity'; import { AuthProviderSyncHistory } from './auth-provider-sync-history'; import { AuthUser } from './auth-user'; import { CredentialsEntity } from './credentials-entity'; import { EventDestinations } from './event-destinations'; -import { ExecutionAnnotation } from './execution-annotation'; +import { ExecutionAnnotation } from './execution-annotation.ee'; import { ExecutionData } from './execution-data'; import { ExecutionEntity } from './execution-entity'; import { ExecutionMetadata } from './execution-metadata'; diff --git a/packages/cli/src/databases/repositories/annotation-tag-mapping.repository.ts b/packages/cli/src/databases/repositories/annotation-tag-mapping.repository.ee.ts similarity index 97% rename from packages/cli/src/databases/repositories/annotation-tag-mapping.repository.ts rename to packages/cli/src/databases/repositories/annotation-tag-mapping.repository.ee.ts index c8c4a80d31..07bb79815b 100644 --- a/packages/cli/src/databases/repositories/annotation-tag-mapping.repository.ts +++ b/packages/cli/src/databases/repositories/annotation-tag-mapping.repository.ee.ts @@ -1,7 +1,7 @@ import { DataSource, Repository } from '@n8n/typeorm'; import { Service } from 'typedi'; -import { AnnotationTagMapping } from '@/databases/entities/annotation-tag-mapping'; +import { AnnotationTagMapping } from '@/databases/entities/annotation-tag-mapping.ee'; @Service() export class AnnotationTagMappingRepository extends Repository { diff --git a/packages/cli/src/databases/repositories/annotation-tag.repository.ts b/packages/cli/src/databases/repositories/annotation-tag.repository.ee.ts similarity index 94% rename from packages/cli/src/databases/repositories/annotation-tag.repository.ts rename to packages/cli/src/databases/repositories/annotation-tag.repository.ee.ts index 2f4b847ba6..e3aa993460 100644 --- a/packages/cli/src/databases/repositories/annotation-tag.repository.ts +++ b/packages/cli/src/databases/repositories/annotation-tag.repository.ee.ts @@ -1,7 +1,7 @@ import { DataSource, Repository } from '@n8n/typeorm'; import { Service } from 'typedi'; -import { AnnotationTagEntity } from '@/databases/entities/annotation-tag-entity'; +import { AnnotationTagEntity } from '@/databases/entities/annotation-tag-entity.ee'; @Service() export class AnnotationTagRepository extends Repository { diff --git a/packages/cli/src/databases/repositories/execution-annotation.repository.ts b/packages/cli/src/databases/repositories/execution-annotation.repository.ts index 81d4917173..97ca972733 100644 --- a/packages/cli/src/databases/repositories/execution-annotation.repository.ts +++ b/packages/cli/src/databases/repositories/execution-annotation.repository.ts @@ -1,7 +1,7 @@ import { DataSource, Repository } from '@n8n/typeorm'; import { Service } from 'typedi'; -import { ExecutionAnnotation } from '@/databases/entities/execution-annotation'; +import { ExecutionAnnotation } from '@/databases/entities/execution-annotation.ee'; @Service() export class ExecutionAnnotationRepository extends Repository { diff --git a/packages/cli/src/databases/repositories/execution.repository.ts b/packages/cli/src/databases/repositories/execution.repository.ts index 52c7fd65f3..b99bd8adee 100644 --- a/packages/cli/src/databases/repositories/execution.repository.ts +++ b/packages/cli/src/databases/repositories/execution.repository.ts @@ -36,9 +36,9 @@ import type { import { Service } from 'typedi'; import config from '@/config'; -import { AnnotationTagEntity } from '@/databases/entities/annotation-tag-entity'; -import { AnnotationTagMapping } from '@/databases/entities/annotation-tag-mapping'; -import { ExecutionAnnotation } from '@/databases/entities/execution-annotation'; +import { AnnotationTagEntity } from '@/databases/entities/annotation-tag-entity.ee'; +import { AnnotationTagMapping } from '@/databases/entities/annotation-tag-mapping.ee'; +import { ExecutionAnnotation } from '@/databases/entities/execution-annotation.ee'; import { PostgresLiveRowsRetrievalError } from '@/errors/postgres-live-rows-retrieval.error'; import type { ExecutionSummaries } from '@/executions/execution.types'; import type { diff --git a/packages/cli/src/executions/execution.service.ts b/packages/cli/src/executions/execution.service.ts index a04c10e45f..53023fce9a 100644 --- a/packages/cli/src/executions/execution.service.ts +++ b/packages/cli/src/executions/execution.service.ts @@ -21,7 +21,7 @@ import { ActiveExecutions } from '@/active-executions'; import { ConcurrencyControlService } from '@/concurrency/concurrency-control.service'; import config from '@/config'; import type { User } from '@/databases/entities/user'; -import { AnnotationTagMappingRepository } from '@/databases/repositories/annotation-tag-mapping.repository'; +import { AnnotationTagMappingRepository } from '@/databases/repositories/annotation-tag-mapping.repository.ee'; import { ExecutionAnnotationRepository } from '@/databases/repositories/execution-annotation.repository'; import { ExecutionRepository } from '@/databases/repositories/execution.repository'; import type { IGetExecutionsQueryFilter } from '@/databases/repositories/execution.repository'; diff --git a/packages/cli/src/generic-helpers.ts b/packages/cli/src/generic-helpers.ts index 47ef1a796b..e5978bb34a 100644 --- a/packages/cli/src/generic-helpers.ts +++ b/packages/cli/src/generic-helpers.ts @@ -1,6 +1,6 @@ import { validate } from 'class-validator'; -import type { AnnotationTagEntity } from '@/databases/entities/annotation-tag-entity'; +import type { AnnotationTagEntity } from '@/databases/entities/annotation-tag-entity.ee'; import type { CredentialsEntity } from '@/databases/entities/credentials-entity'; import type { TagEntity } from '@/databases/entities/tag-entity'; import type { User } from '@/databases/entities/user'; diff --git a/packages/cli/src/interfaces.ts b/packages/cli/src/interfaces.ts index 629925e8dc..4d767862bb 100644 --- a/packages/cli/src/interfaces.ts +++ b/packages/cli/src/interfaces.ts @@ -26,7 +26,7 @@ import type { import type PCancelable from 'p-cancelable'; import type { ActiveWorkflowManager } from '@/active-workflow-manager'; -import type { AnnotationTagEntity } from '@/databases/entities/annotation-tag-entity'; +import type { AnnotationTagEntity } from '@/databases/entities/annotation-tag-entity.ee'; import type { AuthProviderType } from '@/databases/entities/auth-identity'; import type { SharedCredentials } from '@/databases/entities/shared-credentials'; import type { TagEntity } from '@/databases/entities/tag-entity'; diff --git a/packages/cli/src/server.ts b/packages/cli/src/server.ts index 27ac3b09a1..0840714b6a 100644 --- a/packages/cli/src/server.ts +++ b/packages/cli/src/server.ts @@ -35,7 +35,7 @@ import type { FrontendService } from '@/services/frontend.service'; import { OrchestrationService } from '@/services/orchestration.service'; import '@/controllers/active-workflows.controller'; -import '@/controllers/annotation-tags.controller'; +import '@/controllers/annotation-tags.controller.ee'; import '@/controllers/auth.controller'; import '@/controllers/binary-data.controller'; import '@/controllers/curl.controller'; diff --git a/packages/cli/src/services/annotation-tag.service.ts b/packages/cli/src/services/annotation-tag.service.ee.ts similarity index 96% rename from packages/cli/src/services/annotation-tag.service.ts rename to packages/cli/src/services/annotation-tag.service.ee.ts index 27c93041b5..671395168c 100644 --- a/packages/cli/src/services/annotation-tag.service.ts +++ b/packages/cli/src/services/annotation-tag.service.ee.ts @@ -1,7 +1,7 @@ import { Service } from 'typedi'; -import type { AnnotationTagEntity } from '@/databases/entities/annotation-tag-entity'; -import { AnnotationTagRepository } from '@/databases/repositories/annotation-tag.repository'; +import type { AnnotationTagEntity } from '@/databases/entities/annotation-tag-entity.ee'; +import { AnnotationTagRepository } from '@/databases/repositories/annotation-tag.repository.ee'; import { validateEntity } from '@/generic-helpers'; import type { IAnnotationTagDb, IAnnotationTagWithCountDb } from '@/interfaces'; diff --git a/packages/cli/test/integration/shared/db/executions.ts b/packages/cli/test/integration/shared/db/executions.ts index dac3124681..e09ca44dfb 100644 --- a/packages/cli/test/integration/shared/db/executions.ts +++ b/packages/cli/test/integration/shared/db/executions.ts @@ -4,7 +4,7 @@ import Container from 'typedi'; import type { ExecutionData } from '@/databases/entities/execution-data'; import type { ExecutionEntity } from '@/databases/entities/execution-entity'; import type { WorkflowEntity } from '@/databases/entities/workflow-entity'; -import { AnnotationTagRepository } from '@/databases/repositories/annotation-tag.repository'; +import { AnnotationTagRepository } from '@/databases/repositories/annotation-tag.repository.ee'; import { ExecutionDataRepository } from '@/databases/repositories/execution-data.repository'; import { ExecutionMetadataRepository } from '@/databases/repositories/execution-metadata.repository'; import { ExecutionRepository } from '@/databases/repositories/execution.repository'; diff --git a/packages/cli/test/integration/shared/test-db.ts b/packages/cli/test/integration/shared/test-db.ts index 365bc81fa8..f899cc7e90 100644 --- a/packages/cli/test/integration/shared/test-db.ts +++ b/packages/cli/test/integration/shared/test-db.ts @@ -87,9 +87,18 @@ const repositories = [ */ export async function truncate(names: Array<(typeof repositories)[number]>) { for (const name of names) { - const RepositoryClass: Class> = - // eslint-disable-next-line n8n-local-rules/no-dynamic-import-template - (await import(`@/databases/repositories/${kebabCase(name)}.repository`))[`${name}Repository`]; + let RepositoryClass: Class>; + + try { + RepositoryClass = (await import(`@/databases/repositories/${kebabCase(name)}.repository`))[ + `${name}Repository` + ]; + } catch (e) { + RepositoryClass = (await import(`@/databases/repositories/${kebabCase(name)}.repository.ee`))[ + `${name}Repository` + ]; + } + await Container.get(RepositoryClass).delete({}); } } diff --git a/packages/cli/test/integration/shared/utils/test-server.ts b/packages/cli/test/integration/shared/utils/test-server.ts index f16bbf9833..e54a88fbdc 100644 --- a/packages/cli/test/integration/shared/utils/test-server.ts +++ b/packages/cli/test/integration/shared/utils/test-server.ts @@ -140,7 +140,7 @@ export const setupTestServer = ({ for (const group of endpointGroups) { switch (group) { case 'annotationTags': - await import('@/controllers/annotation-tags.controller'); + await import('@/controllers/annotation-tags.controller.ee'); break; case 'credentials': diff --git a/packages/editor-ui/src/components/AnnotationTagsContainer.vue b/packages/editor-ui/src/components/AnnotationTagsContainer.ee.vue similarity index 100% rename from packages/editor-ui/src/components/AnnotationTagsContainer.vue rename to packages/editor-ui/src/components/AnnotationTagsContainer.ee.vue diff --git a/packages/editor-ui/src/components/AnnotationTagsDropdown.vue b/packages/editor-ui/src/components/AnnotationTagsDropdown.ee.vue similarity index 100% rename from packages/editor-ui/src/components/AnnotationTagsDropdown.vue rename to packages/editor-ui/src/components/AnnotationTagsDropdown.ee.vue diff --git a/packages/editor-ui/src/components/Modals.vue b/packages/editor-ui/src/components/Modals.vue index a29e6c0779..396e70ce02 100644 --- a/packages/editor-ui/src/components/Modals.vue +++ b/packages/editor-ui/src/components/Modals.vue @@ -48,7 +48,7 @@ import DuplicateWorkflowDialog from '@/components/DuplicateWorkflowDialog.vue'; import ModalRoot from '@/components/ModalRoot.vue'; import PersonalizationModal from '@/components/PersonalizationModal.vue'; import WorkflowTagsManager from '@/components/TagsManager/WorkflowTagsManager.vue'; -import AnnotationTagsManager from '@/components/TagsManager/AnnotationTagsManager.vue'; +import AnnotationTagsManager from '@/components/TagsManager/AnnotationTagsManager.ee.vue'; import UpdatesPanel from '@/components/UpdatesPanel.vue'; import NpsSurvey from '@/components/NpsSurvey.vue'; import WorkflowLMChat from '@/components/WorkflowLMChat/WorkflowLMChat.vue'; diff --git a/packages/editor-ui/src/components/TagsManager/AnnotationTagsManager.vue b/packages/editor-ui/src/components/TagsManager/AnnotationTagsManager.ee.vue similarity index 100% rename from packages/editor-ui/src/components/TagsManager/AnnotationTagsManager.vue rename to packages/editor-ui/src/components/TagsManager/AnnotationTagsManager.ee.vue diff --git a/packages/editor-ui/src/components/executions/ExecutionsFilter.vue b/packages/editor-ui/src/components/executions/ExecutionsFilter.vue index f4ac47c595..08afe7cceb 100644 --- a/packages/editor-ui/src/components/executions/ExecutionsFilter.vue +++ b/packages/editor-ui/src/components/executions/ExecutionsFilter.vue @@ -15,7 +15,7 @@ import { usePostHog } from '@/stores/posthog.store'; import { useTelemetry } from '@/composables/useTelemetry'; import type { Placement } from '@floating-ui/core'; import { useDebounce } from '@/composables/useDebounce'; -import AnnotationTagsDropdown from '@/components/AnnotationTagsDropdown.vue'; +import AnnotationTagsDropdown from '@/components/AnnotationTagsDropdown.ee.vue'; export type ExecutionFilterProps = { workflows?: Array; diff --git a/packages/editor-ui/src/components/executions/workflow/WorkflowExecutionAnnotationPanel.vue b/packages/editor-ui/src/components/executions/workflow/WorkflowExecutionAnnotationPanel.ee.vue similarity index 99% rename from packages/editor-ui/src/components/executions/workflow/WorkflowExecutionAnnotationPanel.vue rename to packages/editor-ui/src/components/executions/workflow/WorkflowExecutionAnnotationPanel.ee.vue index 437cfd8e12..424c38aad8 100644 --- a/packages/editor-ui/src/components/executions/workflow/WorkflowExecutionAnnotationPanel.vue +++ b/packages/editor-ui/src/components/executions/workflow/WorkflowExecutionAnnotationPanel.ee.vue @@ -2,7 +2,7 @@ import { ref, computed } from 'vue'; import type { AnnotationVote, ExecutionSummary } from 'n8n-workflow'; import { useExecutionsStore } from '@/stores/executions.store'; -import AnnotationTagsDropdown from '@/components/AnnotationTagsDropdown.vue'; +import AnnotationTagsDropdown from '@/components/AnnotationTagsDropdown.ee.vue'; import { createEventBus } from 'n8n-design-system'; import VoteButtons from '@/components/executions/workflow/VoteButtons.vue'; import { useToast } from '@/composables/useToast';