mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
refactor(core): Do not import BaseCommand outside src/commands
(no-changelog) (#7008)
This commit is contained in:
parent
fb05afa165
commit
72f65dcdd6
|
@ -21,9 +21,6 @@ import { InternalHooks } from '@/InternalHooks';
|
|||
import { PostHogClient } from '@/posthog';
|
||||
import { License } from '@/License';
|
||||
|
||||
export const UM_FIX_INSTRUCTION =
|
||||
'Please fix the database by running ./packages/cli/bin/n8n user-management:reset';
|
||||
|
||||
export abstract class BaseCommand extends Command {
|
||||
protected logger = LoggerProxy.init(getLogger());
|
||||
|
||||
|
|
|
@ -10,10 +10,11 @@ import { SharedCredentials } from '@db/entities/SharedCredentials';
|
|||
import type { Role } from '@db/entities/Role';
|
||||
import { CredentialsEntity } from '@db/entities/CredentialsEntity';
|
||||
import { disableAutoGeneratedIds } from '@db/utils/commandHelpers';
|
||||
import { BaseCommand, UM_FIX_INSTRUCTION } from '../BaseCommand';
|
||||
import { BaseCommand } from '../BaseCommand';
|
||||
import type { ICredentialsEncrypted } from 'n8n-workflow';
|
||||
import { jsonParse } from 'n8n-workflow';
|
||||
import { RoleService } from '@/services/role.service';
|
||||
import { UM_FIX_INSTRUCTION } from '@/constants';
|
||||
|
||||
export class ImportCredentialsCommand extends BaseCommand {
|
||||
static description = 'Import credentials';
|
||||
|
|
|
@ -14,10 +14,11 @@ import type { User } from '@db/entities/User';
|
|||
import { disableAutoGeneratedIds } from '@db/utils/commandHelpers';
|
||||
import type { ICredentialsDb, IWorkflowToImport } from '@/Interfaces';
|
||||
import { replaceInvalidCredentials } from '@/WorkflowHelpers';
|
||||
import { BaseCommand, UM_FIX_INSTRUCTION } from '../BaseCommand';
|
||||
import { BaseCommand } from '../BaseCommand';
|
||||
import { generateNanoId } from '@db/utils/generators';
|
||||
import { RoleService } from '@/services/role.service';
|
||||
import { TagService } from '@/services/tag.service';
|
||||
import { UM_FIX_INSTRUCTION } from '@/constants';
|
||||
|
||||
function assertHasWorkflowsToImport(workflows: unknown): asserts workflows is IWorkflowToImport[] {
|
||||
if (!Array.isArray(workflows)) {
|
||||
|
|
|
@ -90,3 +90,6 @@ export const LICENSE_QUOTAS = {
|
|||
export const UNLIMITED_LICENSE_QUOTA = -1;
|
||||
|
||||
export const CREDENTIAL_BLANKING_VALUE = '__n8n_BLANK_VALUE_e5362baf-c777-4d57-a609-6eaf1f9e87f6';
|
||||
|
||||
export const UM_FIX_INSTRUCTION =
|
||||
'Please fix the database by running ./packages/cli/bin/n8n user-management:reset';
|
||||
|
|
|
@ -15,7 +15,6 @@ import { Credentials, UserSettings } from 'n8n-core';
|
|||
import type { IWorkflowToImport } from '@/Interfaces';
|
||||
import type { ExportableCredential } from './types/exportableCredential';
|
||||
import type { Variables } from '@db/entities/Variables';
|
||||
import { UM_FIX_INSTRUCTION } from '@/commands/BaseCommand';
|
||||
import { SharedCredentials } from '@db/entities/SharedCredentials';
|
||||
import type { WorkflowTagMapping } from '@db/entities/WorkflowTagMapping';
|
||||
import type { TagEntity } from '@db/entities/TagEntity';
|
||||
|
@ -28,6 +27,7 @@ import type { SourceControlledFile } from './types/sourceControlledFile';
|
|||
import { RoleService } from '@/services/role.service';
|
||||
import { VariablesService } from '../variables/variables.service';
|
||||
import { TagRepository } from '@/databases/repositories';
|
||||
import { UM_FIX_INSTRUCTION } from '@/constants';
|
||||
|
||||
@Service()
|
||||
export class SourceControlImportService {
|
||||
|
|
Loading…
Reference in a new issue