- Introduced a new permission settings schema and model to manage user permissions effectively.
- Updated user schema to include a reference to permission settings, allowing for dynamic permission management.
- Enhanced the editObject function to conditionally recalculate permissions based on the new recalculate parameter.
- Added utility functions for applying and retrieving permission settings, improving permission handling across the application.
- Changed the getModelEntryByType function to use dynamic import for models, caching the result to improve performance.
- Updated the editNotification function to await the model entry retrieval, ensuring proper asynchronous handling of model data.
- Introduced notification functionality in the editObject method to notify users of changes when editing objects, enhancing user awareness of updates.
- Added utility functions for creating and managing notifications, including omitSensitive for filtering sensitive data and notificationUserFromOwner for user retrieval based on owner type.
- Updated SocketHost to support the new notify parameter, ensuring notifications can be triggered during object edits.
- Deleted the TemplateManager class and its associated methods for rendering templates and PDFs, streamlining the socket handling code.
- Removed all references to PDF and image rendering in SocketHost, SocketUser, and their tests, ensuring a cleaner codebase.
- Updated package.json and pnpm-lock.yaml to remove dependencies related to PDF generation and image processing, enhancing project simplicity.
- Updated barcode attributes to provide default values when content or attributes are missing, ensuring more robust barcode generation.
- Added error logging in the preview method to capture and log errors more effectively, improving debugging capabilities.
- Introduced a new field `sortSidebarVisibility` in the user settings schema to manage sidebar visibility preferences.
- Updated the user settings manager to include `sortSidebarVisibility` in the settings categories and default settings structure, ensuring proper normalization and handling of this new setting.
- Changed log level in config.json from "debug" to "trace" for enhanced logging detail.
- Updated mongoose version to ^9.9.1 in package.json for better performance and features.
- Added new cors origin in config.json for improved access control.
- Updated pnpm-lock.yaml to reflect changes in package versions and added new dependencies for better compatibility.
- Added "pdf-to-img" version 6.2.0 and "sharp" version 0.34.5 to enhance image processing capabilities.
- Updated package resolutions for various architectures and operating systems for the "sharp" library, ensuring compatibility across platforms.
- Included new entries for "@napi-rs/canvas" packages to support additional image processing functionalities on multiple environments.
- Changed log level in config.json from "debug" to "trace" for more detailed logging.
- Added new dependencies "pdf-to-img" and "sharp" in package.json for image processing capabilities.
- Introduced 'renderTemplateJPG' event handling in SocketHost and SocketUser classes to support JPG rendering.
- Implemented the renderJPG method in TemplateManager for converting templates to JPG format, including error handling and logging.
- Updated the logic to retrieve and validate the parent template content, ensuring it is correctly fetched and checked for string type.
- Improved error logging to provide clearer messages when parent template content is missing or invalid.
- Increased the maximum HTTP buffer size for the Socket.IO server to improve data handling capabilities.
- Added error handling in `handlePreviewTemplateEvent` and `handleRenderTemplatePDFEvent` methods to log errors and return error messages through callbacks.
- Implemented a check for unknown object types in the `TemplateManager` to prevent processing errors and return appropriate error messages.
- Removed unnecessary line breaks in the subjob schema to enhance code clarity.
- Ensured all required fields maintain their definitions for better data integrity.
- Updated formatting for the `state` field to align with coding standards.
- Enhanced the stock event schema by ensuring consistent formatting and removing unnecessary line breaks for better maintainability.
- Updated the filament schema to improve code readability and maintain required fields while maintaining functionality.
- Introduced a new `recalculate` method in the printer schema to manage printer state changes effectively.
- Added logic to handle host disconnection in the socket host, ensuring proper state management and logging.
- Added logic in the pre-validation hook to populate the `part` field in `parts` array based on the `partSku` if it is not already set.
- Improved data integrity by ensuring that part information is correctly retrieved and assigned during validation.
- Introduced a new optional field `code` in the printer schema for additional identification.
- Updated the `_id` field to use a default value generated by `generateId()` for improved uniqueness.
- Ensured schema maintains required fields and defaults for better data integrity.
- Introduced a new optional field `vendor` in the filament schema to reference the vendor associated with the filament.
- Improved code formatting for better readability and maintainability, including consistent indentation and line breaks.
- Ensured that the `recalculate` method remains functional with updated schema structure.
- Cleaned up the stock event schema by removing unnecessary line breaks and ensuring consistent formatting across the code.
- Enhanced readability of function parameters and return statements for better maintainability.
- Made minor adjustments to comments and structure to align with coding standards.
- Introduced a `history` field in filamentStock, partStock, productStock, and stockEvent schemas to maintain historical records of current quantities and weights.
- Enhanced stock event processing to append history entries when values change, ensuring accurate tracking of stock changes over time.
- Implemented utility functions to manage history entries and enforce rate limits on updates for improved data integrity.
- Removed the `getStockEventTotal` function and associated `recalculate` methods from filamentStock, partStock, and productStock schemas to streamline code and reduce redundancy.
- Updated stockEvent schema to include a new `recalculate` method that centralizes stock recalculation logic for improved maintainability.
- Enhanced the stockEvent schema with additional utility functions for building update data and recalculating parent stock based on events.
- Introduced a new optional field `hasThumbnails` in the file schema to indicate the presence of thumbnail images.
- Set the default value of `hasThumbnails` to false for improved data management.
- Introduced the ActivityManager class to handle object activity tracking, including viewing and editing events.
- Implemented methods for setting, clearing, and retrieving activities, as well as subscribing to activity updates via websockets.
- Replaced the LockManager with ActivityManager in SocketUser and SocketManager classes to streamline activity management.
- Added comprehensive tests for ActivityManager to ensure correct functionality and error handling.
- Removed LockManager and its associated tests to eliminate redundancy in functionality.
- Introduced a new utility function `formatTraceData` to standardize the formatting of trace data for logging purposes.
- Updated various modules including auth, database, and stats manager to utilize `formatTraceData` for improved log clarity and consistency.
- Added new schemas for printer profiles and filament profiles to enhance the data model.
- Implemented tests for session authentication to ensure robust functionality and error handling.
- Introduced a new UserSettingsManager class to handle user-specific settings, including retrieval and updates.
- Implemented user settings schema to define defaults and manage user-specific configurations.
- Enhanced SocketUser class to integrate user settings event handlers for getting and updating settings.
- Added comprehensive tests for UserSettingsManager to ensure correct functionality and error handling.
- Added verification for `removeAllListeners` method in both SocketUser and UpdateManager to ensure proper cleanup of event listeners during disconnection handling.
- Added `removeAllListeners` method in UpdateManager to clear all subscriptions efficiently.
- Updated SocketUser's `handleDisconnect` method to log user disconnection more accurately based on user presence.
- Introduced subscription tracking in UpdateManager to manage active subscriptions.
- Introduced 'authorisedAt' and 'declinedAt' fields to the payment schema to track payment status changes.
- Added new rollup configurations for counting and summing authorised and declined payments.