Releases: enfyra/server
Releases · enfyra/server
Enfyra Server v1.4.0
enfyra-server v1.4.0
Added
- WebSocket Module: Dynamic WebSocket Gateway support with Socket.IO
- Dynamic namespace registration per gateway path
- Authentication support via JWT token
- Connection and event handler queues with BullMQ
- Redis-based cache synchronization for multi-instance deployments
- Real-time message broadcasting to users, rooms, and namespaces
WebSocket Features
- Dynamic Gateway Factory: Create and manage WebSocket gateways dynamically
- Event Handlers: Register custom event handlers via scripts
- Connection Handlers: Execute custom logic on client connection
- Permission System: Fine-grained access control per gateway/event
- Multi-Instance Support: Redis pub/sync for cache coordination
Technical Details
- Socket.IO as the WebSocket library
- BullMQ for event queue processing
- Redis for distributed cache and pub/sub
- Dynamic Namespace:
/ws/{gateway-path}
Database Tables
websocket_definition- Gateway configurationswebsocket_event_definition- Event handlers per gateway
Enfyra Server v1.3.4
Release v1.3.4
Changes
Admin Account Configuration
- Move admin account configuration from
init.jsonto environment variables - Add
ADMIN_EMAILandADMIN_PASSWORDto.envandenv_example - Admin account is now automatically created on first init from env variables
- Remove hardcoded admin credentials from source code
Enfyra Server v1.3.3
Release v1.3.3
What's Changed
- Terminology Update: Changed package type terminology from 'Backend' to 'Server' for consistency
- Package Management Enhancement: Improved package management service and controller handling logic
Enfyra Server v1.3.2
Release v1.3.2
Fixed
- Fixed CTE pattern for PostgreSQL and MySQL when querying with nested relations
- Fixed type mismatch between
jsonandjsonbin CTE aggregation queries - Fixed MySQL raw query result parsing (returning object instead of array)
- Fixed
jsonb_aggwithCOALESCEin CTE definitions for PostgreSQL - Improved empty array default handling for JSON aggregation functions
Technical Changes
- Updated
nested-subquery-builder.tsto use'[]'::jsonbinstead of'[]'::jsonfor PostgreSQL CTEs - Improved MySQL raw query result parsing logic to handle multiple formats
- Ensured type consistency between CTE definitions and SELECT clauses
Enfyra Server v1.3.1
Release v1.3.1
Hook System Improvements
Global Hooks
- Added
isGlobalfield to hook definitions for explicit global hook configuration - Global hooks now use
isGlobal: trueinstead of checking route null - Updated default response hook to include all CRUD methods (GET, POST, PATCH, DELETE)
Method Matching
- Removed default "all methods" behavior - hooks now only run for explicitly specified methods
- Each hook must specify which methods it applies to
Query Builder Enhancements
Field Handling
- Fields that don't exist are now silently skipped instead of causing errors
- Improved error handling for invalid field references
Relation Filtering
- Added support for filtering relations directly using ID operators:
parent._is_null/parent._is_not_null- Check if relation existsparent._eq/parent._neq- Compare relation IDparent._in/parent._not_in- Match relation IDs in array
- Both direct filtering (
parent._eq: 3) and explicit ID filtering (parent.id._eq: 3) are supported - Works for both SQL and MongoDB databases
Enfyra Server v1.3.0
Release v1.3.0
Breaking Changes
Hook System Refactor
- Refactored hook definition structure: Split
hook_definitiontable into two separate tables:pre_hook_definition: Hooks that execute before route handlerspost_hook_definition: Hooks that execute after route handlers
- Both tables now use a unified
codefield (type: code) instead of separatepreHookandafterHookfields - Both tables maintain relationship with
route_definitionvia inverse propertiespreHookandpostHook - Updated all hook execution logic in middleware and interceptors to use the new structure
Changes
- Removed test files from the repository
- Removed "Handlers" and "Hooks" menu items from default configuration (now managed in Routings)
Migration Notes
Existing hook definitions need to be migrated:
- Pre-hooks: Move
preHookcode topre_hook_definition.code - Post-hooks: Move
afterHookcode topost_hook_definition.code - Update timeout fields:
preHookTimeout→timeout(in pre_hook_definition),afterHookTimeout→timeout(in post_hook_definition)
Enfyra Server v1.2.7
Release v1.2.7
Database Configuration & Replication
URI-Based Configuration
- Standardized database configuration to use URI format (Prisma style) for all database types
- Supports MySQL, PostgreSQL, and MongoDB with consistent
DB_URIformat - Backward compatible with legacy separate environment variables
- URL encoding support for passwords with special characters
SQL Replication Support
- Master-replica replication with automatic read/write routing
- Read queries automatically route to replicas using round-robin
- Write queries (INSERT, UPDATE, DELETE) always use master
- Transactions always use master for consistency
- Connection pool automatically distributed between master and replicas based on configured ratio
Features
- Health checks for replica nodes with automatic failover
DB_READ_FROM_MASTERoption to include master in round-robin pool for reads- Automatic pool distribution: master gets 60% by default, remaining 40% divided among replicas
- Configurable pool distribution ratio via
DB_POOL_MASTER_RATIO
Configuration
DB_URI: Master/write connection URIDB_REPLICA_URIS: Comma-separated replica URIs for read operationsDB_READ_FROM_MASTER: Include master in read pool (default: false)DB_POOL_MASTER_RATIO: Pool distribution ratio (default: 0.6)
Enfyra Server v1.2.6
Release v1.2.6 – Text Search & JSON Handling
-
Text search optimization (MySQL-first)
- Added generated search columns and indexes to support efficient
_contains,_starts_with,_ends_withon text fields. - Kept query semantics compatible with existing LIKE-based Vietnamese search (using
unaccent).
- Added generated search columns and indexes to support efficient
-
Standardized
simple-jsonstorage- Simplified type system: removed
jsonas a schema type, kept onlysimple-json. - Mapped
simple-jsontoTEXT/LONGTEXTin SQL; stringify/parse handled via centralized hooks. - Updated type-mapping helpers so
any→simple-jsonand DBjson/jsonb→ TSstring.
- Simplified type system: removed
-
Column/Relation metadata improvements
- Added
metadatafield to column definitions and wired it through DTOs, table-creation/update flows, and snapshot schema. - Ensured metadata, options, and default values for metadata tables are consistently
JSON.stringify/JSON.parsed.
- Added
-
Migration and MySQL compatibility fixes
- Fixed
ALTER TABLE ... DROP COLUMN IF EXISTSfor MySQL (now uses a compatible variant). - Cleaned up JSON-related DDL generation and column operations to always align with the new
simple-jsonTEXT strategy.
- Fixed
Enfyra Server v1.2.5
Release Notes - v1.2.5
🎉 Overview
This release focuses on improving MongoDB support, fixing file upload consistency, and enhancing image processing capabilities.
✨ New Features
MongoDB Support Enhancements
- ObjectId Normalization: MongoDB ObjectId fields are now automatically converted to strings in query results, ensuring consistent API responses
- Assets Endpoint MongoDB Support: Assets endpoint now fully supports MongoDB, correctly handling storage config lookups and file retrieval
- Improved Type Conversion: Enhanced foreign key field handling for MongoDB, automatically converting string IDs to ObjectId when needed
🐛 Bug Fixes
MongoDB Query Builder
- Filter Builder Improvements: Fixed
idto_idconversion logic to properly check database type before conversion - Relation Filter Null Handling: Fixed issue where MongoDB aggregation pipelines incorrectly filtered out documents with
nullrelations when explicitly querying for null values - Operator Consistency: Aligned MongoDB filter operators with SQL implementation (
_contains,_starts_with,_ends_withinstead oflike) - Type Converter: Improved handling of foreign key fields ending with
Idto correctly convert to ObjectId for MongoDB
File Management
- Saga Pattern Implementation: Implemented Saga pattern for file uploads to ensure data consistency. If database save fails, the uploaded file is automatically deleted from cloud storage
- Storage Config Cache: Fixed MongoDB ObjectId handling in storage config cache service
- File Upload DTO: Updated to accept both
number(SQL) andstring(MongoDB ObjectId) forfolderandstorageConfigfields
Image Processing
- AVIF Quality Handling: Fixed issue where AVIF format would fail when quality parameter is provided. AVIF now ignores quality parameter and only converts format
- Error Handling: Improved error logging for image processing failures
Database Schema
- MongoDB Schema Migration: Fixed
biginttolongBSON type conversion for fields likefilesize - Type Mapping: Enhanced type mapping in schema migration to include more column types (
varchar,char,richtext,smallint,tinyint,double,numeric,real,simple-json,enum)
🔧 Technical Improvements
Code Quality
- Database Type Handling: Refactored to pass
dbTypeas a separate parameter instead of embedding it in metadata, keeping metadata clean and database-agnostic - Error Messages: Enhanced MongoDB validation error messages to include detailed schema rule violations
- Type Safety: Improved TypeScript type handling for MongoDB ObjectId conversions
Breaking Changes
None
Migration Notes
No migration required. All changes are backward compatible.
Dependencies
No new dependencies added.
Acknowledgments
Thanks to all contributors and testers who helped identify and fix issues in this release.
Enfyra Server v1.2.4
Release Notes v1.2.4
🚀 New Features
Schema Migration
- Enhanced schema migration lock service with database type handling (PostgreSQL/MySQL)
- Added
onDeletecolumn support torelation_definitiontable
AI Agent Improvements
- Added batching rules for CRUD operations (100 records per batch)
- Improved conversation handling with conversation ID in system prompts
- Enhanced error handling in batch dynamic repository operations
- Added confirmation requirements for destructive operations
🔧 Improvements
- Refactored AI agent utilities and tool definitions
- Improved system prompt builder and conversation summary service
- Enhanced LLM service with better provider handling
- Updated table creation workflow and tool selection helpers
🗑️ Removed
- Removed DeepSeek LLM provider support
- Removed CONTRIBUTING.md
📝 Documentation
- Updated hints for CRUD write operations with batching guidelines
- Improved error handling documentation in AI agent prompts