Skip to content

Releases: clean-code-id/nest-sequelize-auditor

v4.0.0

28 Aug 02:58

Choose a tag to compare

🎯 What's on in this Release?

  1. Developer Experience: Simpler, more intuitive API
  2. Consistency: Global creator configuration ensures uniform behavior
  3. Performance: Zero-cost relationships (metadata only)
  4. Maintainability: Less configuration = fewer bugs
  5. Security: Global creator field filtering prevents accidental data exposure

v3.0.0

21 Aug 05:56

Choose a tag to compare

🎉 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 onModuleInit calls

💥 BREAKING CHANGES

  • Removed attachAuditHooks() - now decorator-only approach
  • Must use @Auditable decorator 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

20 Aug 06:22

Choose a tag to compare

🚀 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
    Updated audit model to use actorableType and actorableId for 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 actorableType and actorableId.
    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