From c0811b218a2d02d34d281003f03db9cf2b9415c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Wed, 14 Aug 2024 11:30:26 +0200 Subject: [PATCH] refactor(core): Make new configs consistent (no-changelog) (#10393) --- .../src/configs/{cache.ts => cache.config.ts} | 0 .../{credentials.ts => credentials.config.ts} | 0 .../{database.ts => database.config.ts} | 0 .../{endpoints.ts => endpoints.config.ts} | 0 .../{event-bus.ts => event-bus.config.ts} | 0 ...-secrets.ts => external-secrets.config.ts} | 0 ...-storage.ts => external-storage.config.ts} | 0 .../src/configs/{nodes.ts => nodes.config.ts} | 0 .../{public-api.ts => public-api.config.ts} | 0 .../{templates.ts => templates.config.ts} | 0 .../{email.ts => user-management.config.ts} | 12 +++- ...ons.ts => version-notifications.config.ts} | 0 .../{workflows.ts => workflows.config.ts} | 0 packages/@n8n/config/src/index.ts | 68 +++++++++---------- 14 files changed, 40 insertions(+), 40 deletions(-) rename packages/@n8n/config/src/configs/{cache.ts => cache.config.ts} (100%) rename packages/@n8n/config/src/configs/{credentials.ts => credentials.config.ts} (100%) rename packages/@n8n/config/src/configs/{database.ts => database.config.ts} (100%) rename packages/@n8n/config/src/configs/{endpoints.ts => endpoints.config.ts} (100%) rename packages/@n8n/config/src/configs/{event-bus.ts => event-bus.config.ts} (100%) rename packages/@n8n/config/src/configs/{external-secrets.ts => external-secrets.config.ts} (100%) rename packages/@n8n/config/src/configs/{external-storage.ts => external-storage.config.ts} (100%) rename packages/@n8n/config/src/configs/{nodes.ts => nodes.config.ts} (100%) rename packages/@n8n/config/src/configs/{public-api.ts => public-api.config.ts} (100%) rename packages/@n8n/config/src/configs/{templates.ts => templates.config.ts} (100%) rename packages/@n8n/config/src/configs/{email.ts => user-management.config.ts} (92%) rename packages/@n8n/config/src/configs/{version-notifications.ts => version-notifications.config.ts} (100%) rename packages/@n8n/config/src/configs/{workflows.ts => workflows.config.ts} (100%) diff --git a/packages/@n8n/config/src/configs/cache.ts b/packages/@n8n/config/src/configs/cache.config.ts similarity index 100% rename from packages/@n8n/config/src/configs/cache.ts rename to packages/@n8n/config/src/configs/cache.config.ts diff --git a/packages/@n8n/config/src/configs/credentials.ts b/packages/@n8n/config/src/configs/credentials.config.ts similarity index 100% rename from packages/@n8n/config/src/configs/credentials.ts rename to packages/@n8n/config/src/configs/credentials.config.ts diff --git a/packages/@n8n/config/src/configs/database.ts b/packages/@n8n/config/src/configs/database.config.ts similarity index 100% rename from packages/@n8n/config/src/configs/database.ts rename to packages/@n8n/config/src/configs/database.config.ts diff --git a/packages/@n8n/config/src/configs/endpoints.ts b/packages/@n8n/config/src/configs/endpoints.config.ts similarity index 100% rename from packages/@n8n/config/src/configs/endpoints.ts rename to packages/@n8n/config/src/configs/endpoints.config.ts diff --git a/packages/@n8n/config/src/configs/event-bus.ts b/packages/@n8n/config/src/configs/event-bus.config.ts similarity index 100% rename from packages/@n8n/config/src/configs/event-bus.ts rename to packages/@n8n/config/src/configs/event-bus.config.ts diff --git a/packages/@n8n/config/src/configs/external-secrets.ts b/packages/@n8n/config/src/configs/external-secrets.config.ts similarity index 100% rename from packages/@n8n/config/src/configs/external-secrets.ts rename to packages/@n8n/config/src/configs/external-secrets.config.ts diff --git a/packages/@n8n/config/src/configs/external-storage.ts b/packages/@n8n/config/src/configs/external-storage.config.ts similarity index 100% rename from packages/@n8n/config/src/configs/external-storage.ts rename to packages/@n8n/config/src/configs/external-storage.config.ts diff --git a/packages/@n8n/config/src/configs/nodes.ts b/packages/@n8n/config/src/configs/nodes.config.ts similarity index 100% rename from packages/@n8n/config/src/configs/nodes.ts rename to packages/@n8n/config/src/configs/nodes.config.ts diff --git a/packages/@n8n/config/src/configs/public-api.ts b/packages/@n8n/config/src/configs/public-api.config.ts similarity index 100% rename from packages/@n8n/config/src/configs/public-api.ts rename to packages/@n8n/config/src/configs/public-api.config.ts diff --git a/packages/@n8n/config/src/configs/templates.ts b/packages/@n8n/config/src/configs/templates.config.ts similarity index 100% rename from packages/@n8n/config/src/configs/templates.ts rename to packages/@n8n/config/src/configs/templates.config.ts diff --git a/packages/@n8n/config/src/configs/email.ts b/packages/@n8n/config/src/configs/user-management.config.ts similarity index 92% rename from packages/@n8n/config/src/configs/email.ts rename to packages/@n8n/config/src/configs/user-management.config.ts index f0e130c3b4..2c603a7148 100644 --- a/packages/@n8n/config/src/configs/email.ts +++ b/packages/@n8n/config/src/configs/user-management.config.ts @@ -1,7 +1,7 @@ import { Config, Env, Nested } from '../decorators'; @Config -export class SmtpAuth { +class SmtpAuth { /** SMTP login username */ @Env('N8N_SMTP_USER') user = ''; @@ -20,7 +20,7 @@ export class SmtpAuth { } @Config -export class SmtpConfig { +class SmtpConfig { /** SMTP server host */ @Env('N8N_SMTP_HOST') host = ''; @@ -65,7 +65,7 @@ export class TemplateConfig { } @Config -export class EmailConfig { +class EmailConfig { /** How to send emails */ @Env('N8N_EMAIL_MODE') mode: '' | 'smtp' = 'smtp'; @@ -76,3 +76,9 @@ export class EmailConfig { @Nested template: TemplateConfig; } + +@Config +export class UserManagementConfig { + @Nested + emails: EmailConfig; +} diff --git a/packages/@n8n/config/src/configs/version-notifications.ts b/packages/@n8n/config/src/configs/version-notifications.config.ts similarity index 100% rename from packages/@n8n/config/src/configs/version-notifications.ts rename to packages/@n8n/config/src/configs/version-notifications.config.ts diff --git a/packages/@n8n/config/src/configs/workflows.ts b/packages/@n8n/config/src/configs/workflows.config.ts similarity index 100% rename from packages/@n8n/config/src/configs/workflows.ts rename to packages/@n8n/config/src/configs/workflows.config.ts diff --git a/packages/@n8n/config/src/index.ts b/packages/@n8n/config/src/index.ts index 88e6fb0117..a5b970eab4 100644 --- a/packages/@n8n/config/src/index.ts +++ b/packages/@n8n/config/src/index.ts @@ -1,85 +1,79 @@ import { Config, Env, Nested } from './decorators'; -import { CredentialsConfig } from './configs/credentials'; -import { DatabaseConfig } from './configs/database'; -import { EmailConfig } from './configs/email'; -import { VersionNotificationsConfig } from './configs/version-notifications'; -import { PublicApiConfig } from './configs/public-api'; -import { ExternalSecretsConfig } from './configs/external-secrets'; -import { TemplatesConfig } from './configs/templates'; -import { EventBusConfig } from './configs/event-bus'; -import { NodesConfig } from './configs/nodes'; -import { ExternalStorageConfig } from './configs/external-storage'; -import { WorkflowsConfig } from './configs/workflows'; -import { EndpointsConfig } from './configs/endpoints'; -import { CacheConfig } from './configs/cache'; +import { CredentialsConfig } from './configs/credentials.config'; +import { DatabaseConfig } from './configs/database.config'; +import { VersionNotificationsConfig } from './configs/version-notifications.config'; +import { PublicApiConfig } from './configs/public-api.config'; +import { ExternalSecretsConfig } from './configs/external-secrets.config'; +import { TemplatesConfig } from './configs/templates.config'; +import { EventBusConfig } from './configs/event-bus.config'; +import { NodesConfig } from './configs/nodes.config'; +import { ExternalStorageConfig } from './configs/external-storage.config'; +import { WorkflowsConfig } from './configs/workflows.config'; +import { EndpointsConfig } from './configs/endpoints.config'; +import { CacheConfig } from './configs/cache.config'; import { ScalingModeConfig } from './configs/scaling-mode.config'; - -@Config -class UserManagementConfig { - @Nested - emails: EmailConfig; -} +import { UserManagementConfig } from './configs/user-management.config'; @Config export class GlobalConfig { @Nested - readonly database: DatabaseConfig; + database: DatabaseConfig; @Nested - readonly credentials: CredentialsConfig; + credentials: CredentialsConfig; @Nested - readonly userManagement: UserManagementConfig; + userManagement: UserManagementConfig; @Nested - readonly versionNotifications: VersionNotificationsConfig; + versionNotifications: VersionNotificationsConfig; @Nested - readonly publicApi: PublicApiConfig; + publicApi: PublicApiConfig; @Nested - readonly externalSecrets: ExternalSecretsConfig; + externalSecrets: ExternalSecretsConfig; @Nested - readonly templates: TemplatesConfig; + templates: TemplatesConfig; @Nested - readonly eventBus: EventBusConfig; + eventBus: EventBusConfig; @Nested - readonly nodes: NodesConfig; + nodes: NodesConfig; @Nested - readonly externalStorage: ExternalStorageConfig; + externalStorage: ExternalStorageConfig; @Nested - readonly workflows: WorkflowsConfig; + workflows: WorkflowsConfig; /** Path n8n is deployed to */ @Env('N8N_PATH') - readonly path: string = '/'; + path = '/'; /** Host name n8n can be reached */ @Env('N8N_HOST') - readonly host: string = 'localhost'; + host = 'localhost'; /** HTTP port n8n can be reached */ @Env('N8N_PORT') - readonly port: number = 5678; + port = 5678; /** IP address n8n should listen on */ @Env('N8N_LISTEN_ADDRESS') - readonly listen_address: string = '0.0.0.0'; + listen_address = '0.0.0.0'; /** HTTP Protocol via which n8n can be reached */ @Env('N8N_PROTOCOL') - readonly protocol: 'http' | 'https' = 'http'; + protocol: 'http' | 'https' = 'http'; @Nested - readonly endpoints: EndpointsConfig; + endpoints: EndpointsConfig; @Nested - readonly cache: CacheConfig; + cache: CacheConfig; @Nested queue: ScalingModeConfig;