Releases: clean-code-id/nest-sequelize-auditor
Releases · clean-code-id/nest-sequelize-auditor
v4.0.0
🎯 What's on in this Release?
- Developer Experience: Simpler, more intuitive API
- Consistency: Global creator configuration ensures uniform behavior
- Performance: Zero-cost relationships (metadata only)
- Maintainability: Less configuration = fewer bugs
- Security: Global creator field filtering prevents accidental data exposure
v3.0.0
🎉 Major release with streamlined API
✨ NEW FEATURES
- Auditable decorator with auto-initialization - no more manual setup!
- Built-in creator relationships - simply use
include: ["creator"] - actorTypes configuration for reliable polymorphic relationships
- Empty audit table support - works even when audit table is empty at startup
- Auto-initialization - eliminates manual
onModuleInitcalls
💥 BREAKING CHANGES
- Removed
attachAuditHooks()- now decorator-only approach - Must use
@Auditabledecorator on model classes - Migration required from manual setup to decorator approach
🚀 BENEFITS
- Cleaner API - single, consistent way to set up auditing
- Better DX - declarative decorator approach is more intuitive
- No configuration repetition - configure once in module, use everywhere
- Automatic relationships - polymorphic actor associations created automatically
📦 Installation
npm install @cleancode-id/nestjs-sequelize-auditor@3.0.0
🔧 Quick Setup
// Configure module with actorTypes
AuditModule.forRoot({
actorTypes: ["User"], // Essential for creator relationships
auth: { actorModel: "User" }
})
// Add decorator to models
@Auditable({
exclude: ["password"],
enableCreatorRelationship: true
})
@Table()
export class User extends Model {}
// Use creator relationships
const user = await User.findByPk(1, {
include: ["creator"] // ✨ Gets who created this user!
});
📊 Test Coverage
- 64 tests passing across 6 test suites
- 13 new tests specifically for v3.0.0 features
- Full backwards compatibility with existing functionality
Thank you for using @cleancode-id/nestjs-sequelize-auditor! 🙏v2.0.0
🚀 Release v2.0.0
This release introduces major improvements to the auditor with new features, refactors, and optimizations.
✨ Features
-
Bulk Operations Support
Added support for auditing bulk operations with individual record tracking.
Includes performance optimizations to ensure scalable logging. -
Refactored Audit Model & Context
Updatedauditmodel to useactorableTypeandactorableIdfor improved clarity and consistency across polymorphic relationships. -
Polymorphic Support Enhancements
Extended polymorphic audit tracking and updated documentation to reflect new usage patterns.
🛠 Improvements
- Enhanced ESLint configuration for stricter code quality and consistency.
- Updated README.md with polymorphic usage examples and clarified setup steps.
⚠️ Breaking Changes
- The audit model now expects
actorableTypeandactorableId.
If you were relying on the old field structure, please update your schema and integration code accordingly.
📦 Versioning
- Previous stable: v1.2.1
- Current release: v2.0.0