mailer-advance 3.0.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mailer-advance",
3
- "version": "3.0.0",
3
+ "version": "4.0.0",
4
4
  "description": "Advanced Node.js email service with dynamic SMTP configuration, multi-database support (MongoDB/SQL), and a built-in UI.",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -4,6 +4,9 @@ import { BaseRepository } from './base.repository.js';
4
4
 
5
5
  export class MongoRepository extends BaseRepository {
6
6
  async connect(uri) {
7
+ if (!uri || typeof uri !== 'string') {
8
+ throw new Error('Database connection URI is required for MongoDB repository');
9
+ }
7
10
  await mongoose.connect(uri);
8
11
  console.log('Connected to MongoDB');
9
12
  }
@@ -8,6 +8,9 @@ export class SqlRepository extends BaseRepository {
8
8
  }
9
9
 
10
10
  async connect(uri) {
11
+ if (!uri || typeof uri !== 'string') {
12
+ throw new Error(`Database connection URI is required for SQL repository (${this.dialect})`);
13
+ }
11
14
  this.sequelize = new Sequelize(uri, {
12
15
  dialect: this.dialect,
13
16
  logging: false