fix(interfaces): Remove legacy interfaces

This commit is contained in:
2025-05-27 21:03:17 +00:00
parent 6aa54d974e
commit 8d59d617f1
19 changed files with 91 additions and 1863 deletions

View File

@ -1,4 +1,3 @@
import type { IBaseConfig, ITlsConfig, IQueueConfig, IRateLimitConfig, IMonitoringConfig } from './base.config.js';
/**
* MIGRATION GUIDE:
@ -157,476 +156,4 @@ export interface IDomainRule {
}>;
}
/**
* Email service configuration
* @deprecated Use IUnifiedEmailServerOptions from mail/routing/classes.unified.email.server.ts instead
* This interface is kept for backward compatibility only
*/
export interface IEmailConfig extends IBaseConfig {
/**
* Whether to enable email functionality
*/
useEmail?: boolean;
/**
* Whether to use MTA service (legacy compatibility)
*/
useMta?: boolean;
/**
* MTA configuration (legacy compatibility)
*/
mtaConfig?: IMtaConfig;
/**
* Whether the email server is behind SmartProxy (uses internal ports)
*/
behindSmartProxy?: boolean;
/**
* Email server configuration for both sending and receiving
*/
serverConfig?: IEmailServerConfig;
/**
* Email ports to listen on
*/
ports?: number[];
/**
* Email server hostname
*/
hostname?: string;
/**
* TLS configuration
*/
tls?: ITlsConfig;
/**
* Domain routing rules
*/
domainRules?: IDomainRule[];
/**
* Default processing mode for emails
*/
defaultMode?: EmailProcessingMode;
/**
* Default server for forwarding
*/
defaultServer?: string;
/**
* Default port for forwarding
*/
defaultPort?: number;
/**
* Default TLS setting for forwarding
*/
defaultTls?: boolean;
/**
* Maximum message size in bytes
*/
maxMessageSize?: number;
/**
* Authentication settings
*/
auth?: {
/**
* Whether authentication is required
*/
required?: boolean;
/**
* Supported authentication methods
*/
methods?: ('PLAIN' | 'LOGIN' | 'OAUTH2')[];
/**
* User credentials
*/
users?: Array<{username: string, password: string}>;
};
/**
* Queue configuration
*/
queue?: IQueueConfig;
/**
* Template configuration
*/
templateConfig?: {
/**
* Default sender email address
*/
from?: string;
/**
* Default reply-to email address
*/
replyTo?: string;
/**
* Default footer HTML
*/
footerHtml?: string;
/**
* Default footer text
*/
footerText?: string;
};
/**
* Whether to load templates from directory
*/
loadTemplatesFromDir?: boolean;
/**
* Directory path for email templates
*/
templatesDir?: string;
}
/**
* MTA configuration
* @deprecated Use IUnifiedEmailServerOptions from mail/routing/classes.unified.email.server.ts instead
* This interface is kept for backward compatibility only
*/
export interface IMtaConfig {
/**
* SMTP server configuration
*/
smtp?: {
/**
* Whether to enable the SMTP server
*/
enabled?: boolean;
/**
* Port to listen on
*/
port?: number;
/**
* SMTP server hostname
*/
hostname?: string;
/**
* Maximum allowed email size in bytes
*/
maxSize?: number;
};
/**
* TLS configuration
*/
tls?: ITlsConfig;
/**
* Outbound email configuration
*/
outbound?: {
/**
* Maximum concurrent sending jobs
*/
concurrency?: number;
/**
* Retry configuration
*/
retries?: {
/**
* Maximum number of retries per message
*/
max?: number;
/**
* Initial delay between retries (milliseconds)
*/
delay?: number;
/**
* Whether to use exponential backoff for retries
*/
useBackoff?: boolean;
};
/**
* Rate limiting configuration
*/
rateLimit?: IRateLimitConfig;
/**
* IP warmup configuration
*/
warmup?: {
/**
* Whether IP warmup is enabled
*/
enabled?: boolean;
/**
* IP addresses to warm up
*/
ipAddresses?: string[];
/**
* Target domains to warm up
*/
targetDomains?: string[];
/**
* Allocation policy to use
*/
allocationPolicy?: string;
/**
* Fallback percentage for ESP routing during warmup
*/
fallbackPercentage?: number;
};
/**
* Reputation monitoring configuration
*/
reputation?: IMonitoringConfig & {
/**
* Alert thresholds
*/
alertThresholds?: {
/**
* Minimum acceptable reputation score
*/
minReputationScore?: number;
/**
* Maximum acceptable complaint rate
*/
maxComplaintRate?: number;
};
};
};
/**
* Security settings
*/
security?: {
/**
* Whether to use DKIM signing
*/
useDkim?: boolean;
/**
* Whether to verify inbound DKIM signatures
*/
verifyDkim?: boolean;
/**
* Whether to verify SPF on inbound
*/
verifySpf?: boolean;
/**
* Whether to verify DMARC on inbound
*/
verifyDmarc?: boolean;
/**
* Whether to enforce DMARC policy
*/
enforceDmarc?: boolean;
/**
* Whether to use TLS for outbound when available
*/
useTls?: boolean;
/**
* Whether to require valid certificates
*/
requireValidCerts?: boolean;
/**
* Log level for email security events
*/
securityLogLevel?: 'info' | 'warn' | 'error';
/**
* Whether to check IP reputation for inbound emails
*/
checkIPReputation?: boolean;
/**
* Whether to scan content for malicious payloads
*/
scanContent?: boolean;
/**
* Action to take when malicious content is detected
*/
maliciousContentAction?: 'tag' | 'quarantine' | 'reject';
/**
* Minimum threat score to trigger action
*/
threatScoreThreshold?: number;
/**
* Whether to reject connections from high-risk IPs
*/
rejectHighRiskIPs?: boolean;
};
/**
* Domains configuration
*/
domains?: {
/**
* List of domains that this MTA will handle as local
*/
local?: string[];
/**
* Whether to auto-create DNS records
*/
autoCreateDnsRecords?: boolean;
/**
* DKIM selector to use
*/
dkimSelector?: string;
};
/**
* Queue configuration
*/
queue?: IQueueConfig;
}
/**
* Email server configuration
*/
export interface IEmailServerConfig {
/**
* Server ports
*/
ports?: number[];
/**
* Server hostname
*/
hostname?: string;
/**
* TLS configuration
*/
tls?: ITlsConfig;
/**
* Security settings
*/
security?: {
/**
* Whether to use DKIM signing
*/
useDkim?: boolean;
/**
* Whether to verify inbound DKIM signatures
*/
verifyDkim?: boolean;
/**
* Whether to verify SPF on inbound
*/
verifySpf?: boolean;
/**
* Whether to verify DMARC on inbound
*/
verifyDmarc?: boolean;
/**
* Whether to enforce DMARC policy
*/
enforceDmarc?: boolean;
/**
* Whether to use TLS for outbound when available
*/
useTls?: boolean;
/**
* Whether to require valid certificates
*/
requireValidCerts?: boolean;
/**
* Log level for email security events
*/
securityLogLevel?: 'info' | 'warn' | 'error';
/**
* Whether to check IP reputation for inbound emails
*/
checkIPReputation?: boolean;
/**
* Whether to scan content for malicious payloads
*/
scanContent?: boolean;
/**
* Action to take when malicious content is detected
*/
maliciousContentAction?: 'tag' | 'quarantine' | 'reject';
/**
* Minimum threat score to trigger action
*/
threatScoreThreshold?: number;
};
/**
* Delivery settings
*/
delivery?: {
/**
* Concurrency settings
*/
concurrency?: number;
/**
* Rate limiting configuration
*/
rateLimit?: IRateLimitConfig;
/**
* Retry configuration
*/
retries?: {
/**
* Maximum retry attempts
*/
max?: number;
/**
* Base delay between retries in milliseconds
*/
delay?: number;
/**
* Whether to use exponential backoff
*/
useBackoff?: boolean;
};
};
}

View File

@ -10,7 +10,6 @@ export * from './schemas.js';
// Re-export commonly used types
import type { IPlatformConfig } from './platform.config.js';
import type { IEmailConfig, IMtaConfig } from './email.config.js';
import type { ISmsConfig } from './sms.config.js';
import type {
IBaseConfig,
@ -38,46 +37,8 @@ export const defaultConfig: IPlatformConfig = {
port: 3000,
cors: true
},
email: {
useMta: true,
mtaConfig: {
smtp: {
enabled: true,
port: 25,
hostname: 'mta.lossless.one',
maxSize: 10 * 1024 * 1024 // 10MB
},
tls: {
domain: 'mta.lossless.one',
autoRenew: true
},
security: {
useDkim: true,
verifyDkim: true,
verifySpf: true,
verifyDmarc: true,
enforceDmarc: true,
useTls: true,
requireValidCerts: false,
securityLogLevel: 'warn',
checkIPReputation: true,
scanContent: true,
maliciousContentAction: 'tag',
threatScoreThreshold: 50,
rejectHighRiskIPs: false
},
domains: {
local: ['lossless.one'],
autoCreateDnsRecords: true,
dkimSelector: 'mta'
}
},
templateConfig: {
from: 'no-reply@lossless.one',
replyTo: 'support@lossless.one'
},
loadTemplatesFromDir: true
},
// Email configuration removed - use IUnifiedEmailServerOptions in DcRouter instead
email: undefined,
paths: {
dataDir: 'data',
logsDir: 'logs',
@ -89,8 +50,6 @@ export const defaultConfig: IPlatformConfig = {
// Export main types for convenience
export type {
IPlatformConfig,
IEmailConfig,
IMtaConfig,
ISmsConfig,
IBaseConfig,
ITlsConfig,

View File

@ -1,5 +1,4 @@
import type { IBaseConfig, IHttpServerConfig, IDatabaseConfig } from './base.config.js';
import type { IEmailConfig } from './email.config.js';
import type { ISmsConfig } from './sms.config.js';
/**
@ -19,8 +18,9 @@ export interface IPlatformConfig extends IBaseConfig {
/**
* Email service configuration
* @deprecated - Use IUnifiedEmailServerOptions in DcRouter instead
*/
email?: IEmailConfig;
email?: any;
/**
* SMS service configuration