feat(storage): add comprehensive tests for StorageManager with memory, filesystem, and custom function backends
Some checks failed
CI / Type Check & Lint (push) Failing after 3s
CI / Build Test (Current Platform) (push) Failing after 3s
CI / Build All Platforms (push) Failing after 3s

feat(email): implement EmailSendJob class for robust email delivery with retry logic and MX record resolution

feat(mail): restructure mail module exports for simplified access to core and delivery functionalities
This commit is contained in:
2025-10-28 19:46:17 +00:00
parent 6523c55516
commit 17f5661636
271 changed files with 61736 additions and 6222 deletions

View File

@@ -1,11 +1,12 @@
import * as plugins from '../../plugins.ts';
import { EventEmitter } from 'node:events';
import type { IEmailRoute, IEmailMatch, IEmailAction, IEmailContext } from './interfaces.ts';
import type { Email } from '../core/classes.email.ts';
/**
* Email router that evaluates routes and determines actions
*/
export class EmailRouter extends plugins.EventEmitter {
export class EmailRouter extends EventEmitter {
private routes: IEmailRoute[];
private patternCache: Map<string, boolean> = new Map();
private storageManager?: any; // StorageManager instance
@@ -407,7 +408,7 @@ export class EmailRouter extends plugins.EventEmitter {
}
const routesData = JSON.stringify(this.routes, null, 2);
await this.storageManager.set('/email/routes/config.tson', routesData);
await this.storageManager.set('/email/routes/config.json', routesData);
this.emit('routesPersisted', this.routes.length);
} catch (error) {
@@ -430,7 +431,7 @@ export class EmailRouter extends plugins.EventEmitter {
}
try {
const routesData = await this.storageManager.get('/email/routes/config.tson');
const routesData = await this.storageManager.get('/email/routes/config.json');
if (!routesData) {
return [];