refactor(core): Standardize filename casing for services and Public API (no-changelog) (#10579)

This commit is contained in:
Iván Ovejero 2024-08-28 13:59:27 +02:00 committed by GitHub
parent dca797e4db
commit d7241cfc3a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
226 changed files with 177 additions and 172 deletions

View file

@ -9,7 +9,7 @@ const __dirname = path.dirname(__filename);
const ROOT_DIR = path.resolve(__dirname, '..');
const SPEC_FILENAME = 'openapi.yml';
const SPEC_THEME_FILENAME = 'swaggerTheme.css';
const SPEC_THEME_FILENAME = 'swagger-theme.css';
const publicApiEnabled = process.env.N8N_PUBLIC_API_DISABLED !== 'true';
@ -32,15 +32,15 @@ function copyUserManagementEmailTemplates() {
function copySwaggerTheme() {
const swaggerTheme = {
source: path.resolve(ROOT_DIR, 'src', 'PublicApi', SPEC_THEME_FILENAME),
destination: path.resolve(ROOT_DIR, 'dist', 'PublicApi'),
source: path.resolve(ROOT_DIR, 'src', 'public-api', SPEC_THEME_FILENAME),
destination: path.resolve(ROOT_DIR, 'dist', 'public-api'),
};
shell.cp('-r', swaggerTheme.source, swaggerTheme.destination);
}
function bundleOpenApiSpecs() {
const publicApiDir = path.resolve(ROOT_DIR, 'src', 'PublicApi');
const publicApiDir = path.resolve(ROOT_DIR, 'src', 'public-api');
shell
.find(publicApiDir)

View file

@ -3,7 +3,7 @@ import { mock } from 'jest-mock-extended';
import type { ExecutionRepository } from '@/databases/repositories/execution.repository';
import type { IExecutionResponse } from '@/Interfaces';
import { OrchestrationService } from '@/services/orchestration.service';
import type { MultiMainSetup } from '@/services/orchestration/main/MultiMainSetup.ee';
import type { MultiMainSetup } from '@/services/orchestration/main/multi-main-setup.ee';
jest.useFakeTimers();

View file

@ -4,7 +4,7 @@ import type { User } from '@/databases/entities/User';
import { WorkflowRunner } from '@/workflow-runner';
import config from '@/config';
import * as testDb from '@test-integration/testDb';
import * as testDb from '@test-integration/test-db';
import { setupTestServer } from '@test-integration/utils';
import { createUser } from '@test-integration/db/users';
import { createWorkflow } from '@test-integration/db/workflows';

View file

@ -45,7 +45,7 @@ import { Logger } from './logger';
import { WorkflowRepository } from '@/databases/repositories/workflow.repository';
import { OrchestrationService } from '@/services/orchestration.service';
import { ActivationErrorsService } from '@/activation-errors.service';
import { ActiveWorkflowsService } from '@/services/activeWorkflows.service';
import { ActiveWorkflowsService } from '@/services/active-workflows.service';
import { WorkflowExecutionService } from '@/workflows/workflow-execution.service';
import { WorkflowStaticDataService } from '@/workflows/workflow-static-data.service';
import { OnShutdown } from '@/decorators/on-shutdown';

View file

@ -13,7 +13,7 @@ import type { ICredentialsOverwrite } from '@/Interfaces';
import { CredentialsOverwrites } from '@/credentials-overwrites';
import { rawBodyReader, bodyParser } from '@/middlewares';
import { MessageEventBus } from '@/eventbus/message-event-bus/message-event-bus';
import type { RedisServicePubSubSubscriber } from '@/services/redis/RedisServicePubSubSubscriber';
import type { RedisServicePubSubSubscriber } from '@/services/redis/redis-service-pub-sub-subscriber';
import { EventMessageGeneric } from '@/eventbus/event-message-classes/event-message-generic';
import { OrchestrationHandlerWorkerService } from '@/services/orchestration/worker/orchestration.handler.worker.service';
import { OrchestrationWorkerService } from '@/services/orchestration/worker/orchestration.worker.service';

View file

@ -1,6 +1,6 @@
import { DynamicNodeParametersController } from '@/controllers/dynamic-node-parameters.controller';
import type { DynamicNodeParametersRequest } from '@/requests';
import type { DynamicNodeParametersService } from '@/services/dynamicNodeParameters.service';
import type { DynamicNodeParametersService } from '@/services/dynamic-node-parameters.service';
import { mock } from 'jest-mock-extended';
import * as AdditionalData from '@/workflow-execute-additional-data';
import type { ILoadOptions, IWorkflowExecuteAdditionalData } from 'n8n-workflow';

View file

@ -13,7 +13,7 @@ import { ExternalHooks } from '@/external-hooks';
import { License } from '@/license';
import { BadRequestError } from '@/errors/response-errors/bad-request.error';
import { EventService } from '@/events/event.service';
import { badPasswords } from '@test/testData';
import { badPasswords } from '@test/test-data';
import { mockInstance } from '@test/mocking';
import { AuthUserRepository } from '@/databases/repositories/auth-user.repository';
import { InvalidAuthTokenRepository } from '@/databases/repositories/invalid-auth-token.repository';

View file

@ -16,7 +16,7 @@ import type { UserService } from '@/services/user.service';
import { PasswordUtility } from '@/services/password.utility';
import { mockInstance } from '@test/mocking';
import { badPasswords } from '@test/testData';
import { badPasswords } from '@test/test-data';
describe('OwnerController', () => {
const configGetSpy = jest.spyOn(config, 'getEnv');

View file

@ -1,6 +1,6 @@
import { Get, RestController } from '@/decorators';
import { ActiveWorkflowRequest } from '@/requests';
import { ActiveWorkflowsService } from '@/services/activeWorkflows.service';
import { ActiveWorkflowsService } from '@/services/active-workflows.service';
@RestController('/active-workflows')
export class ActiveWorkflowsController {

View file

@ -1,5 +1,5 @@
import { Post, RestController } from '@/decorators';
import { AiAssistantService } from '@/services/aiAsisstant.service';
import { AiAssistantService } from '@/services/ai-assistant.service';
import { AiAssistantRequest } from '@/requests';
import { Response } from 'express';
import type { AiAssistantSDK } from '@n8n_io/ai-assistant-sdk';

View file

@ -2,7 +2,7 @@ import type { INodePropertyOptions, NodeParameterValueType } from 'n8n-workflow'
import { Post, RestController } from '@/decorators';
import { getBase } from '@/workflow-execute-additional-data';
import { DynamicNodeParametersService } from '@/services/dynamicNodeParameters.service';
import { DynamicNodeParametersService } from '@/services/dynamic-node-parameters.service';
import { DynamicNodeParametersRequest } from '@/requests';
import { BadRequestError } from '@/errors/response-errors/bad-request.error';

View file

@ -21,7 +21,7 @@ import { Logger } from '@/logger';
import { ExternalHooks } from '@/external-hooks';
import { BadRequestError } from '@/errors/response-errors/bad-request.error';
import { UserRepository } from '@/databases/repositories/user.repository';
import { isApiEnabled } from '@/PublicApi';
import { isApiEnabled } from '@/public-api';
import { EventService } from '@/events/event.service';
import { MfaService } from '@/mfa/mfa.service';
import { InvalidMfaCodeError } from '@/errors/response-errors/invalid-mfa-code.error';

View file

@ -4,7 +4,7 @@ import type { ExecutionPayload, IExecutionDb } from '@/Interfaces';
import pick from 'lodash/pick';
import { isWorkflowIdValid } from '@/utils';
import { ExecutionRepository } from '@/databases/repositories/execution.repository';
import { ExecutionMetadataService } from '@/services/executionMetadata.service';
import { ExecutionMetadataService } from '@/services/execution-metadata.service';
import { Logger } from '@/logger';
export function determineFinalExecutionStatus(runData: IRun): ExecutionStatus {

View file

@ -6,7 +6,7 @@ import { InstanceSettings } from 'n8n-core';
import { mockInstance } from '@test/mocking';
import { createWorkflow } from '@test-integration/db/workflows';
import { createExecution } from '@test-integration/db/executions';
import * as testDb from '@test-integration/testDb';
import * as testDb from '@test-integration/test-db';
import { mock } from 'jest-mock-extended';
import { ExecutionRecoveryService } from '@/executions/execution-recovery.service';

View file

@ -11,7 +11,7 @@ import {
ErrorProvider,
FailedProvider,
MockProviders,
} from '@test/ExternalSecrets/utils';
} from '@test/external-secrets/utils';
import { mock } from 'jest-mock-extended';
describe('External Secrets Manager', () => {

View file

@ -13,7 +13,7 @@ import {
} from './constants';
import { SettingsRepository } from '@/databases/repositories/settings.repository';
import type { BooleanLicenseFeature, N8nInstanceType, NumericLicenseFeature } from './Interfaces';
import type { RedisServicePubSubPublisher } from './services/redis/RedisServicePubSubPublisher';
import type { RedisServicePubSubPublisher } from './services/redis/redis-service-pub-sub-publisher';
import { RedisService } from './services/redis.service';
import { OrchestrationService } from '@/services/orchestration.service';
import { OnShutdown } from '@/decorators/on-shutdown';

View file

@ -36,7 +36,7 @@ async function createApiRouter(
if (!Container.get(GlobalConfig).publicApi.swaggerUiDisabled) {
const { serveFiles, setup } = await import('swagger-ui-express');
const swaggerThemePath = path.join(__dirname, 'swaggerTheme.css');
const swaggerThemePath = path.join(__dirname, 'swagger-theme.css');
const swaggerThemeCss = await fs.readFile(swaggerThemePath, { encoding: 'utf-8' });
apiController.use(

View file

@ -1,6 +1,6 @@
import { globalScope } from '@/PublicApi/v1/shared/middlewares/global.middleware';
import { globalScope } from '@/public-api/v1/shared/middlewares/global.middleware';
import type { Response } from 'express';
import type { AuditRequest } from '@/PublicApi/types';
import type { AuditRequest } from '@/public-api/types';
import Container from 'typedi';
export = {

View file

@ -1,7 +1,7 @@
import { globalScope, isLicensed, validCursor } from '../../shared/middlewares/global.middleware';
import type { Response } from 'express';
import type { ProjectRequest } from '@/requests';
import type { PaginatedRequest } from '@/PublicApi/types';
import type { PaginatedRequest } from '@/public-api/types';
import Container from 'typedi';
import { ProjectController } from '@/controllers/project.controller';
import { ProjectRepository } from '@/databases/repositories/project.repository';

View file

@ -1,6 +1,6 @@
post:
x-eov-operation-id: pull
x-eov-operation-handler: v1/handlers/sourceControl/sourceControl.handler
x-eov-operation-handler: v1/handlers/source-control/source-control.handler
tags:
- SourceControl
summary: Pull changes from the remote repository

View file

@ -5,7 +5,7 @@ import { globalScope, isLicensed, validCursor } from '../../shared/middlewares/g
import { encodeNextCursor } from '../../shared/services/pagination.service';
import type { Response } from 'express';
import type { VariablesRequest } from '@/requests';
import type { PaginatedRequest } from '@/PublicApi/types';
import type { PaginatedRequest } from '@/public-api/types';
type Create = VariablesRequest.Create;
type Delete = VariablesRequest.Delete;

View file

@ -73,7 +73,7 @@ paths:
/users/{id}/role:
$ref: './handlers/users/spec/paths/users.id.role.yml'
/source-control/pull:
$ref: './handlers/sourceControl/spec/paths/sourceControl.yml'
$ref: './handlers/source-control/spec/paths/sourceControl.yml'
/variables:
$ref: './handlers/variables/spec/paths/variables.yml'
/variables/{id}:

View file

@ -23,9 +23,9 @@ CredentialType:
Audit:
$ref: './../../../handlers/audit/spec/schemas/audit.yml'
Pull:
$ref: './../../../handlers/sourceControl/spec/schemas/pull.yml'
$ref: './../../../handlers/source-control/spec/schemas/pull.yml'
ImportResult:
$ref: './../../../handlers/sourceControl/spec/schemas/importResult.yml'
$ref: './../../../handlers/source-control/spec/schemas/importResult.yml'
UserList:
$ref: './../../../handlers/users/spec/schemas/userList.yml'
User:

Some files were not shown because too many files have changed in this diff Show more