Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(core): Standardize filenames in cli (no-changelog) #10484

Merged
merged 7 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions packages/cli/scripts/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ if (publicApiEnabled) {

function copyUserManagementEmailTemplates() {
const templates = {
source: path.resolve(ROOT_DIR, 'src', 'UserManagement', 'email', 'templates'),
destination: path.resolve(ROOT_DIR, 'dist', 'UserManagement', 'email'),
source: path.resolve(ROOT_DIR, 'src', 'user-management', 'email', 'templates'),
destination: path.resolve(ROOT_DIR, 'dist', 'user-management', 'email'),
};

shell.cp('-r', templates.source, templates.destination);
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/Interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import type {
StartNodeData,
} from 'n8n-workflow';

import type { ActiveWorkflowManager } from '@/ActiveWorkflowManager';
import type { ActiveWorkflowManager } from '@/active-workflow-manager';

import type { WorkflowExecute } from 'n8n-core';

Expand All @@ -39,7 +39,7 @@ import type { CredentialsRepository } from '@db/repositories/credentials.reposit
import type { SettingsRepository } from '@db/repositories/settings.repository';
import type { UserRepository } from '@db/repositories/user.repository';
import type { WorkflowRepository } from '@db/repositories/workflow.repository';
import type { ExternalHooks } from './ExternalHooks';
import type { ExternalHooks } from './external-hooks';
import type { LICENSE_FEATURES, LICENSE_QUOTAS } from './constants';
import type { WorkflowWithSharingsAndCredentials } from './workflows/workflows.types';
import type { RunningJobSummary } from './scaling/types';
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/PublicApi/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import type { HttpError } from 'express-openapi-validator/dist/framework/types';
import type { OpenAPIV3 } from 'openapi-types';
import type { JsonObject } from 'swagger-ui-express';

import { License } from '@/License';
import { License } from '@/license';
import { UserRepository } from '@db/repositories/user.repository';
import { UrlService } from '@/services/url.service';
import type { AuthenticatedRequest } from '@/requests';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export = {
globalScope('securityAudit:generate'),
async (req: AuditRequest.Generate, res: Response): Promise<Response> => {
try {
const { SecurityAuditService } = await import('@/security-audit/SecurityAudit.service');
const { SecurityAuditService } = await import('@/security-audit/security-audit.service');
const result = await Container.get(SecurityAuditService).run(
req.body?.additionalOptions?.categories,
req.body?.additionalOptions?.daysAbandonedWorkflow,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* eslint-disable @typescript-eslint/no-unsafe-argument */
import type express from 'express';

import { CredentialsHelper } from '@/CredentialsHelper';
import { CredentialTypes } from '@/CredentialTypes';
import { CredentialsHelper } from '@/credentials-helper';
import { CredentialTypes } from '@/credential-types';
import type { CredentialsEntity } from '@db/entities/CredentialsEntity';
import type { CredentialTypeRequest, CredentialRequest } from '../../../types';
import { projectScope } from '../../shared/middlewares/global.middleware';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import type express from 'express';
import { validate } from 'jsonschema';

import { CredentialsHelper } from '@/CredentialsHelper';
import { CredentialTypes } from '@/CredentialTypes';
import { CredentialsHelper } from '@/credentials-helper';
import { CredentialTypes } from '@/credential-types';
import type { CredentialRequest } from '../../../types';
import { toJsonSchema } from './credentials.service';
import { Container } from 'typedi';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import type { ICredentialsDb } from '@/Interfaces';
import { CredentialsEntity } from '@db/entities/CredentialsEntity';
import { SharedCredentials } from '@db/entities/SharedCredentials';
import type { User } from '@db/entities/User';
import { ExternalHooks } from '@/ExternalHooks';
import { ExternalHooks } from '@/external-hooks';
import type { IDependency, IJsonSchema } from '../../../types';
import type { CredentialRequest } from '@/requests';
import { Container } from 'typedi';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type express from 'express';
import { Container } from 'typedi';
import { replaceCircularReferences } from 'n8n-workflow';

import { ActiveExecutions } from '@/ActiveExecutions';
import { ActiveExecutions } from '@/active-executions';
import { validCursor } from '../../shared/middlewares/global.middleware';
import type { ExecutionRequest } from '../../../types';
import { getSharedWorkflowIds } from '../workflows/workflows.service';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import type { FindOptionsWhere } from '@n8n/typeorm';
import { In, Like, QueryFailedError } from '@n8n/typeorm';
import { v4 as uuid } from 'uuid';

import { ActiveWorkflowManager } from '@/ActiveWorkflowManager';
import { ActiveWorkflowManager } from '@/active-workflow-manager';
import config from '@/config';
import { WorkflowEntity } from '@db/entities/WorkflowEntity';
import { ExternalHooks } from '@/ExternalHooks';
import { addNodeIds, replaceInvalidCredentials } from '@/WorkflowHelpers';
import { ExternalHooks } from '@/external-hooks';
import { addNodeIds, replaceInvalidCredentials } from '@/workflow-helpers';
import type { WorkflowRequest } from '../../../types';
import { projectScope, validCursor } from '../../shared/middlewares/global.middleware';
import { encodeNextCursor } from '../../shared/services/pagination.service';
Expand All @@ -26,7 +26,7 @@ import {
updateTags,
} from './workflows.service';
import { WorkflowService } from '@/workflows/workflow.service';
import { WorkflowHistoryService } from '@/workflows/workflowHistory/workflowHistory.service.ee';
import { WorkflowHistoryService } from '@/workflows/workflow-history/workflow-history.service.ee';
import { SharedWorkflowRepository } from '@/databases/repositories/sharedWorkflow.repository';
import { TagRepository } from '@/databases/repositories/tag.repository';
import { WorkflowRepository } from '@/databases/repositories/workflow.repository';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import { WorkflowRepository } from '@db/repositories/workflow.repository';
import { SharedWorkflowRepository } from '@db/repositories/sharedWorkflow.repository';
import type { Project } from '@/databases/entities/Project';
import { TagRepository } from '@db/repositories/tag.repository';
import { License } from '@/License';
import { WorkflowSharingService } from '@/workflows/workflowSharing.service';
import { License } from '@/license';
import { WorkflowSharingService } from '@/workflows/workflow-sharing.service';
import type { Scope } from '@n8n/permissions';
import config from '@/config';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
import type express from 'express';
import { Container } from 'typedi';

import { License } from '@/License';
import { License } from '@/license';
import type { AuthenticatedRequest } from '@/requests';

import type { PaginatedRequest } from '../../../types';
import { decodeCursor } from '../services/pagination.service';
import type { Scope } from '@n8n/permissions';
import { userHasScope } from '@/permissions/checkAccess';
import { userHasScope } from '@/permissions/check-access';
import type { BooleanLicenseFeature } from '@/Interfaces';
import { FeatureNotLicensedError } from '@/errors/feature-not-licensed.error';

Expand Down
3 changes: 0 additions & 3 deletions packages/cli/src/UserManagement/email/index.ts

This file was deleted.

4 changes: 2 additions & 2 deletions packages/cli/src/__tests__/License.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { LicenseManager } from '@n8n_io/license-sdk';
import { InstanceSettings } from 'n8n-core';
import { mock } from 'jest-mock-extended';
import config from '@/config';
import { License } from '@/License';
import { Logger } from '@/Logger';
import { License } from '@/license';
import { Logger } from '@/logger';
import { N8N_VERSION } from '@/constants';
import { mockInstance } from '@test/mocking';
import { OrchestrationService } from '@/services/orchestration.service';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ActiveExecutions } from '@/ActiveExecutions';
import { ActiveExecutions } from '@/active-executions';
import PCancelable from 'p-cancelable';
import { v4 as uuid } from 'uuid';
import type { IExecuteResponsePromiseData, IRun } from 'n8n-workflow';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { CredentialTypes } from '@/CredentialTypes';
import { CredentialTypes } from '@/credential-types';
import { Container } from 'typedi';
import { LoadNodesAndCredentials } from '@/LoadNodesAndCredentials';
import { LoadNodesAndCredentials } from '@/load-nodes-and-credentials';
import { mockInstance } from '@test/mocking';

describe('CredentialTypes', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import type {
} from 'n8n-workflow';
import { deepCopy } from 'n8n-workflow';
import { Workflow } from 'n8n-workflow';
import { CredentialsHelper } from '@/CredentialsHelper';
import { NodeTypes } from '@/NodeTypes';
import { LoadNodesAndCredentials } from '@/LoadNodesAndCredentials';
import { CredentialsHelper } from '@/credentials-helper';
import { NodeTypes } from '@/node-types';
import { LoadNodesAndCredentials } from '@/load-nodes-and-credentials';
import { CredentialsRepository } from '@db/repositories/credentials.repository';
import { SharedCredentialsRepository } from '@db/repositories/sharedCredentials.repository';
import { mockInstance } from '@test/mocking';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { WaitTracker } from '@/WaitTracker';
import { WaitTracker } from '@/wait-tracker';
import { mock } from 'jest-mock-extended';
import type { ExecutionRepository } from '@/databases/repositories/execution.repository';
import type { IExecutionResponse } from '@/Interfaces';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { VariablesService } from '@/environments/variables/variables.service.ee';
import { mockInstance } from '@test/mocking';
import { MessageEventBus } from '@/eventbus/MessageEventBus/MessageEventBus';
import { getBase } from '@/WorkflowExecuteAdditionalData';
import { getBase } from '@/workflow-execute-additional-data';
import Container from 'typedi';
import { CredentialsHelper } from '@/CredentialsHelper';
import { SecretsHelper } from '@/SecretsHelpers';
import { CredentialsHelper } from '@/credentials-helper';
import { SecretsHelper } from '@/secrets-helpers';

describe('WorkflowExecuteAdditionalData', () => {
const messageEventBus = mockInstance(MessageEventBus);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type Workflow } from 'n8n-workflow';
import { getExecutionStartNode } from '@/WorkflowHelpers';
import { getExecutionStartNode } from '@/workflow-helpers';
import type { IWorkflowExecutionDataProcess } from '@/Interfaces';

describe('WorkflowHelpers', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Container from 'typedi';
import { WorkflowHooks, type ExecutionError, type IWorkflowExecuteHooks } from 'n8n-workflow';
import type { User } from '@db/entities/User';
import { WorkflowRunner } from '@/WorkflowRunner';
import { WorkflowRunner } from '@/workflow-runner';
import config from '@/config';

import * as testDb from '@test-integration/testDb';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ import config from '@/config';
import { N8N_VERSION, TEMPLATES_DIR, inDevelopment, inTest } from '@/constants';
import * as Db from '@/Db';
import { N8nInstanceType } from '@/Interfaces';
import { ExternalHooks } from '@/ExternalHooks';
import { send, sendErrorResponse } from '@/ResponseHelper';
import { ExternalHooks } from '@/external-hooks';
import { send, sendErrorResponse } from '@/response-helper';
import { rawBodyReader, bodyParser, corsMiddleware } from '@/middlewares';
import { WaitingForms } from '@/WaitingForms';
import { TestWebhooks } from '@/webhooks/TestWebhooks';
import { WaitingWebhooks } from '@/webhooks/WaitingWebhooks';
import { createWebhookHandlerFor } from '@/webhooks/WebhookRequestHandler';
import { LiveWebhooks } from '@/webhooks/LiveWebhooks';
import { WaitingForms } from '@/waiting-forms';
import { TestWebhooks } from '@/webhooks/test-webhooks';
import { WaitingWebhooks } from '@/webhooks/waiting-webhooks';
import { createWebhookHandlerFor } from '@/webhooks/webhook-request-handler';
import { LiveWebhooks } from '@/webhooks/live-webhooks';
import { generateHostInstanceId } from './databases/utils/generators';
import { Logger } from '@/Logger';
import { Logger } from '@/logger';
import { ServiceUnavailableError } from './errors/response-errors/service-unavailable.error';
import { OnShutdown } from '@/decorators/OnShutdown';
import { OnShutdown } from '@/decorators/on-shutdown';
import { GlobalConfig } from '@n8n/config';

@Service()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import type {
} from '@/Interfaces';
import { isWorkflowIdValid } from '@/utils';
import { ExecutionRepository } from '@db/repositories/execution.repository';
import { Logger } from '@/Logger';
import { Logger } from '@/logger';
import { ConcurrencyControlService } from './concurrency/concurrency-control.service';
import config from './config';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,28 +27,28 @@ import {
} from 'n8n-workflow';

import type { IWorkflowDb } from '@/Interfaces';
import * as WebhookHelpers from '@/webhooks/WebhookHelpers';
import * as WorkflowExecuteAdditionalData from '@/WorkflowExecuteAdditionalData';
import * as WebhookHelpers from '@/webhooks/webhook-helpers';
import * as WorkflowExecuteAdditionalData from '@/workflow-execute-additional-data';

import type { WorkflowEntity } from '@db/entities/WorkflowEntity';
import { ActiveExecutions } from '@/ActiveExecutions';
import { ActiveExecutions } from '@/active-executions';
import { ExecutionService } from './executions/execution.service';
import {
STARTING_NODES,
WORKFLOW_REACTIVATE_INITIAL_TIMEOUT,
WORKFLOW_REACTIVATE_MAX_TIMEOUT,
} from '@/constants';
import { NodeTypes } from '@/NodeTypes';
import { ExternalHooks } from '@/ExternalHooks';
import { NodeTypes } from '@/node-types';
import { ExternalHooks } from '@/external-hooks';
import { WebhookService } from '@/webhooks/webhook.service';
import { Logger } from './Logger';
import { Logger } from './logger';
import { WorkflowRepository } from '@db/repositories/workflow.repository';
import { OrchestrationService } from '@/services/orchestration.service';
import { ActivationErrorsService } from '@/ActivationErrors.service';
import { ActivationErrorsService } from '@/activation-errors.service';
import { ActiveWorkflowsService } from '@/services/activeWorkflows.service';
import { WorkflowExecutionService } from '@/workflows/workflowExecution.service';
import { WorkflowStaticDataService } from '@/workflows/workflowStaticData.service';
import { OnShutdown } from '@/decorators/OnShutdown';
import { WorkflowExecutionService } from '@/workflows/workflow-execution.service';
import { WorkflowStaticDataService } from '@/workflows/workflow-static-data.service';
import { OnShutdown } from '@/decorators/on-shutdown';

interface QueuedActivation {
activationMode: WorkflowActivateMode;
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/auth/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import { InvalidAuthTokenRepository } from '@db/repositories/invalidAuthToken.re
import { UserRepository } from '@db/repositories/user.repository';
import { AuthError } from '@/errors/response-errors/auth.error';
import { ForbiddenError } from '@/errors/response-errors/forbidden.error';
import { License } from '@/License';
import { Logger } from '@/Logger';
import { License } from '@/license';
import { Logger } from '@/logger';
import type { AuthenticatedRequest } from '@/requests';
import { JwtService } from '@/services/jwt.service';
import { UrlService } from '@/services/url.service';
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/auth/methods/email.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { User } from '@db/entities/User';
import { PasswordUtility } from '@/services/password.utility';
import { Container } from 'typedi';
import { isLdapLoginEnabled } from '@/Ldap/helpers.ee';
import { isLdapLoginEnabled } from '@/ldap/helpers.ee';
import { UserRepository } from '@db/repositories/user.repository';
import { AuthError } from '@/errors/response-errors/auth.error';
import { EventService } from '@/events/event.service';
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/auth/methods/ldap.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Container } from 'typedi';

import { LdapService } from '@/Ldap/ldap.service.ee';
import { LdapService } from '@/ldap/ldap.service.ee';
import {
createLdapUserOnLocalDb,
getUserByEmail,
Expand All @@ -9,7 +9,7 @@ import {
mapLdapAttributesToUser,
createLdapAuthIdentity,
updateLdapUserOnLocalDb,
} from '@/Ldap/helpers.ee';
} from '@/ldap/helpers.ee';
import type { User } from '@db/entities/User';
import { EventService } from '@/events/event.service';

Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/commands/audit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import { Container } from 'typedi';
import { Flags } from '@oclif/core';
import { ApplicationError } from 'n8n-workflow';

import { SecurityAuditService } from '@/security-audit/SecurityAudit.service';
import { SecurityAuditService } from '@/security-audit/security-audit.service';
import { RISK_CATEGORIES } from '@/security-audit/constants';
import config from '@/config';
import type { Risk } from '@/security-audit/types';
import { BaseCommand } from './BaseCommand';
import { BaseCommand } from './base-command';

export class SecurityAudit extends BaseCommand {
static description = 'Generate a security audit report for this n8n instance';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,25 @@ import { Command, Errors } from '@oclif/core';
import { GlobalConfig } from '@n8n/config';
import { ApplicationError, ErrorReporterProxy as ErrorReporter, sleep } from 'n8n-workflow';
import { BinaryDataService, InstanceSettings, ObjectStoreService } from 'n8n-core';
import type { AbstractServer } from '@/AbstractServer';
import { Logger } from '@/Logger';
import type { AbstractServer } from '@/abstract-server';
import { Logger } from '@/logger';
import config from '@/config';
import * as Db from '@/Db';
import * as CrashJournal from '@/CrashJournal';
import * as CrashJournal from '@/crash-journal';
import { LICENSE_FEATURES, inDevelopment, inTest } from '@/constants';
import { initErrorHandling } from '@/ErrorReporting';
import { ExternalHooks } from '@/ExternalHooks';
import { NodeTypes } from '@/NodeTypes';
import { LoadNodesAndCredentials } from '@/LoadNodesAndCredentials';
import { initErrorHandling } from '@/error-reporting';
import { ExternalHooks } from '@/external-hooks';
import { NodeTypes } from '@/node-types';
import { LoadNodesAndCredentials } from '@/load-nodes-and-credentials';
import type { N8nInstanceType } from '@/Interfaces';
import { PostHogClient } from '@/posthog';
import { InternalHooks } from '@/InternalHooks';
import { License } from '@/License';
import { ExternalSecretsManager } from '@/ExternalSecrets/ExternalSecretsManager.ee';
import { initExpressionEvaluator } from '@/ExpressionEvaluator';
import { InternalHooks } from '@/internal-hooks';
import { License } from '@/license';
import { ExternalSecretsManager } from '@/external-secrets/external-secrets-manager.ee';
import { initExpressionEvaluator } from '@/expression-evaluator';
import { generateHostInstanceId } from '@db/utils/generators';
import { WorkflowHistoryManager } from '@/workflows/workflowHistory/workflowHistoryManager.ee';
import { ShutdownService } from '@/shutdown/Shutdown.service';
import { WorkflowHistoryManager } from '@/workflows/workflow-history/workflow-history-manager.ee';
import { ShutdownService } from '@/shutdown/shutdown.service';
import { TelemetryEventRelay } from '@/events/telemetry-event-relay';

export abstract class BaseCommand extends Command {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/commands/db/__tests__/revert.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { main } from '@/commands/db/revert';
import { mockInstance } from '@test/mocking';
import { Logger } from '@/Logger';
import { Logger } from '@/logger';
import type { IrreversibleMigration, ReversibleMigration } from '@/databases/types';
import type { Migration, MigrationExecutor } from '@n8n/typeorm';
import { type DataSource } from '@n8n/typeorm';
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/commands/db/revert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { DataSourceOptions as ConnectionOptions } from '@n8n/typeorm';
// eslint-disable-next-line n8n-local-rules/misplaced-n8n-typeorm-import
import { MigrationExecutor, DataSource as Connection } from '@n8n/typeorm';
import { Container } from 'typedi';
import { Logger } from '@/Logger';
import { Logger } from '@/logger';
import { getConnectionOptions } from '@db/config';
import type { Migration } from '@db/types';
import { wrapMigration } from '@db/utils/migrationHelpers';
Expand Down
Loading
Loading