UNPKG

waitlist-mailer

Version:

Modern, modular TypeScript library for managing waitlists with pluggable storage and mail providers. Supports MongoDB, SQL databases, and custom adapters with zero required dependencies for basic usage.

84 lines (56 loc) 2.66 kB
# Changelog All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [2.1.0] - 2025-11-25 ### Added - **Database-level search**: `search()` now delegates filtering to storage providers for optimal performance - MongoDB: Uses native `$regex` queries - PostgreSQL: Uses `ILIKE` for case-insensitive search - MySQL/SQLite: Uses `LIKE` with `LOWER()` function - Memory: Optimized in-memory filtering - **Streaming iterator**: New `iterate(batchSize?)` method on `StorageProvider` interface - MongoDB: Uses native Mongoose cursors for memory-efficient streaming - SQL: Uses limit/offset pagination - Enables processing large datasets without loading everything into memory - **Search pagination**: `SearchOptions` interface with `limit`, `offset`, and `caseInsensitive` options - **Safe metadata parsing**: `SequelizeStorage` now validates JSON metadata before parsing - Prevents potential injection attacks from malformed JSON - Validates parsed result is a plain object - **New exported type**: `SearchOptions` now exported from main module - **11 new tests**: Comprehensive tests for search, pagination, and streaming functionality ### Changed - `WaitlistManager.search()` now accepts optional `SearchOptions` parameter - `sendBulkEmails()` now uses streaming when available, falling back to legacy mode - Improved JSDoc documentation for all new methods ### Performance - `search()` no longer loads entire database into memory - `sendBulkEmails()` processes entries one at a time using async iterators - SQL queries properly escape special characters to prevent SQL injection ## [2.0.1] - 2025-11-20 ### Fixed - Minor documentation updates - TypeScript type exports ## [2.0.0] - 2025-11-20 ### Added - Complete rewrite with clean architecture - Dependency injection pattern - Pluggable storage adapters (Memory, Mongoose, Sequelize) - Pluggable mail adapters (Nodemailer, Console) - Generic metadata support - Rich event system - Zero required dependencies for basic usage - 33+ comprehensive tests ### Changed - **BREAKING**: New API - `WaitlistMailer` renamed to `WaitlistManager` - **BREAKING**: Constructor now accepts configuration object - **BREAKING**: `addEmail()` renamed to `join()` - Dependencies moved to peer dependencies ### Removed - Forced dependencies on database drivers - Legacy monolithic architecture ## [1.1.0] - 2025-11-15 ### Added - Initial public release - MongoDB and SQL support - Basic email sending