25 Commits

Author SHA1 Message Date
e1ba1f7871 Implement EventManager integration and enhance socket event handling
- Added EventManager to SocketHost and SocketUser for improved event handling.
- Introduced new socket event handlers for editing objects, listing objects, and subscribing to object actions.
- Refactored authentication logic to streamline host online status updates.
- Enhanced logging and callback mechanisms for better traceability and responsiveness in socket interactions.
2025-09-05 23:30:35 +01:00
ab50a5261d Enhance utility functions and refactor authentication logic
- Added a new jsonToCacheKey function to generate a SHA-256 hash from a canonicalized JSON object for improved caching.
- Updated getModelByName to return the first model directly instead of an array.
- Refactored authentication logic to utilize listObjects for user and host retrieval, ensuring consistent handling of returned data.
- Improved logging for OTP verification to include the specific OTP used in the search.
2025-09-05 23:30:06 +01:00
8ccdc81de1 Refactor ActionManager and introduce EventManager for NATS-based event handling
- Replaced Etcd with NATS in ActionManager for tracking object actions and broadcasting updates.
- Implemented EventManager to handle object events using NATS, including subscription and publishing functionalities.
- Enhanced logging for better traceability of actions and events.
2025-09-05 23:29:47 +01:00
ca78fd6e62 Enhance template manager with additional style attributes
- Added support for color, background, and scale attributes in getNodeStyles function.
- Updated transformCustomElements function to apply dynamic styles to Text, Bold, and Barcode elements.
- Changed Barcode element to use a div container for better structure and styling.
2025-09-05 23:29:28 +01:00
7ccc4bb993 Add NATS messaging support
- Introduced a new NatsServer class for managing NATS connections and messaging.
- Implemented connection handling, publishing, requesting, and subscription management.
- Updated index.js to connect to NATS on application startup and handle connection errors.
- Enhanced logging for NATS operations to improve traceability and error management.
2025-09-05 23:29:14 +01:00
d6214e316b Add message field to alert schema in printer.schema.js 2025-09-05 23:28:39 +01:00
e4c790e7cc Refactor caching mechanism in database.js
- Replaced the previous model cache implementation with a unified object cache using NodeCache for improved performance and simplicity.
- Updated cache retrieval and update functions to support additional parameters such as `populate`, `filter`, `sort`, and `project`.
- Enhanced logging for cache operations to provide better traceability of cache hits and misses.
- Removed deprecated functions and streamlined the caching logic for object and list retrieval.
2025-09-05 23:28:23 +01:00
4ac87f0141 Update package.json and package-lock.json to add new dependencies
- Added @nats-io/nats-core and @nats-io/transport-node (version 3.1.0) for enhanced messaging capabilities.
- Included canonical-json (version 0.2.0) for improved JSON handling.
- Updated package-lock.json to reflect the new dependencies and their respective versions.
2025-09-05 23:27:56 +01:00
9fba977b2a Add .DS_STORE to .gitignore. 2025-09-05 23:27:34 +01:00
b9c2e959b9 Update dependencies in package.json and package-lock.json
- Upgraded several dependencies including axios, dotenv, express, mongodb, and mongoose to their latest versions for improved performance and security.
- Added new dependencies: date-fns, dayjs, ejs, nanoid, node-cache, object-hash, and posthtml to enhance functionality.
- Updated ESLint and related packages to the latest versions for better linting support and configuration.
- Removed deprecated dependencies and ensured compatibility with the latest Node.js versions.
2025-08-18 01:09:29 +01:00
6cc2a07ee0 Add utility functions for database operations
- Introduced a new utils.js file containing various utility functions for database operations.
- Implemented functions for parsing filters, converting objects to camelCase, extracting configuration blocks, and managing audit logs.
- Added functionality to handle ObjectId conversions and filter generation based on query parameters.
- Enhanced object ID handling with functions to flatten and expand ObjectIds for better integration with MongoDB.
2025-08-18 01:09:14 +01:00
1b86d256ca Enhance UpdateManager for object event handling and subscription management
- Refactored constructor to utilize socketClient for improved clarity.
- Added methods to subscribe and unsubscribe from object creation and update events.
- Implemented functionality to retrieve and set object updates in Etcd.
- Improved logging for event handling and error management.
2025-08-18 01:09:00 +01:00
d695772a3a Refactor LockManager to improve key handling and event broadcasting
- Updated constructor to use socketClient instead of socketManager for better clarity.
- Changed key management methods to use a consistent naming convention for setting and deleting locks.
- Enhanced event listener setup to utilize socketClient for broadcasting lock updates.
- Improved logging for lock and unlock operations to provide clearer insights into the locking mechanism.
2025-08-18 01:08:49 +01:00
f5bfbe0d63 Refactor EtcdServer class to enhance event handling and logging
- Introduced separate watchers for prefix and key events, improving organization and clarity.
- Renamed methods for setting and deleting keys to better reflect their functionality.
- Updated logging levels from debug to trace for more granular logging during operations.
- Added functionality to remove watchers for both prefixes and keys, enhancing resource management.
- Improved error handling and callback management for event listeners.
2025-08-18 01:08:36 +01:00
75ccd91b50 Add ActionManager class for object action tracking and websocket integration
- Implemented ActionManager to handle object updates using Etcd and broadcast events via websockets.
- Added methods for subscribing to object actions, removing listeners, and sending object actions with callback handling.
- Integrated logging for better traceability of actions and errors.
2025-08-18 01:08:26 +01:00
110f6d9a57 Update README.md to improve configuration and usage instructions
- Added spacing for better readability in the Etcd, MongoDB, Authentication, and Installation sections.
- Corrected the reference from SocketClient to SocketUser in the Adding New Features section.
- Enhanced the Troubleshooting section with a verification test for etcd.
2025-08-18 01:08:14 +01:00
e2eb240a06 Deleted schema. 2025-08-18 01:07:51 +01:00
53246b70b2 Refactor socket management to remove Keycloak integration
- Eliminated KeycloakAuth from the SocketManager initialization.
- Updated SocketManager to directly use the server instance, simplifying the socket management setup.
2025-08-18 01:07:39 +01:00
43dc41470d Add OTP expiry configuration to config.json
- Introduced otpExpiryMins setting to specify the expiration time for OTPs in minutes.
- Updated configuration structure to enhance authentication management.
2025-08-18 01:07:26 +01:00
3424c17ab3 Refactor socket management: replace SocketClient with SocketUser and SocketHost classes
- Removed SocketClient class and its associated functionality.
- Introduced SocketUser and SocketHost classes to handle user and host socket connections respectively.
- Updated SocketManager to manage user and host connections, including authentication and event handling.
- Enhanced event handling for user actions such as locking, unlocking, and subscribing to updates.
2025-08-18 01:07:14 +01:00
03eb0a61c1 Enhance authentication module with code and OTP verification
- Added CodeAuth class for verifying authentication codes and OTPs against the database.
- Implemented methods to check host status, validate codes, and manage OTP expiration.
- Updated KeycloakAuth to retrieve user information from the database.
- Refactored createAuthMiddleware to handle authentication checks for Socket.IO connections.
2025-08-18 01:06:55 +01:00
ce15d3dbfc Add inventory and management schemas for filament, part, and stock management
- Introduced new schemas for managing inventory, including filamentStock, partStock, stockAudit, stockEvent, and their respective models.
- Added management schemas for user, vendor, material, and various document types to enhance data structure and organization.
- Implemented necessary fields and relationships to support inventory tracking and management functionalities.
2025-08-18 01:06:38 +01:00
5584e61583 Add Template Manager and associated assets for document rendering
- Implemented TemplateManager class for rendering EJS templates with dynamic content.
- Added base template, preview template, content placeholder, and render template EJS files.
- Introduced CSS styles for document layout and presentation.
- Integrated dayjs for date formatting and posthtml for custom element transformation.
2025-08-18 01:05:57 +01:00
bf56234c4b Refactor project structure: remove app.js, update config.json for environment-specific settings, enhance package.json with new scripts and dependencies, and convert websockets.js to ES module syntax with Keycloak authentication integration. 2025-06-29 22:39:23 +01:00
15cb1a03b6 Initial Commit 2024-07-28 17:52:27 +01:00