Revised the file saving process to include better logging and error management. Added groupId to file saving parameters and enhanced verification checks. Updated .gitignore to exclude assets directory.
Introduce a primary key field 'id' with UUID type to the FilesForMachinesTable. This ensures each record is uniquely identifiable and improves database integrity. Additionally, set a default value to a random UUID for new entries.
Changed the file saving path from "files/" to "assets/" to unify storage structure. Improved error handling and logging in the file operations to aid in debugging. Additionally, streamlined database insertion and validation logic in the files service for better efficiency and readability.
Standardized import quotes across files and added a missing trailing comma in storage.module.ts.
Corrected import order in files.module.ts and machines.module.ts for better readability.
Updated file type detection to use 'magic-bytes.js' instead of 'file-type' across various modules. Also added missing exports in 'StorageModule' and imported 'DbModule' in 'MachinesModule'.
Removed outdated TODO comments and enabled `filesService.save` to handle file saving logic. This change ensures that files are properly processed and stored, providing a success message upon completion.
Removed default values for 'isRestricted' and 'isDocumentation' columns in the FilesTable. Added a new intermediary table 'FilesForMachinesTable' to establish a many-to-many relationship between 'File' and 'Machine'.
Corrected inconsistent use of single and double quotes and adjusted indentation for enhanced readability and code style consistency. No functional changes were made in this commit.
Aligned the indentation to use tabs consistently and updated import statements to use double quotes for consistency throughout the file. These changes improve code readability and maintain uniform style.
The DbModule import was moved to ensure proper load order and maintain consistency within the module imports. This change will help in avoiding potential dependency injection issues.
Rearranged the imports in `groups.dto.ts` to maintain alphabetical order and used double quotes for consistency with the rest of the project. This change does not alter functionality but improves code readability and maintainability.
Standardized import quotes in groups controller and reorganized import statements for better readability. Removed unnecessary line breaks in newGroup method.
Implemented detailed logic to check machine and group existence before saving files. Added comprehensive error handling to provide clear feedback when database operations fail. Improved file saving functionality with associations between files and machines.
Change import statements to use double quotes for consistency and adjust property indents to match standard. These modifications improve code readability and maintain uniform coding style throughout the file.
Reformat imports and modify `saveFile` method to include the `uploaded_by` header. Ensure that `_uploadedBy` is checked and added to the parameters alongside other headers.
Corrected spacing around type annotation and added missing semicolon in the `canActivate` method. These changes ensure better code consistency and adhere to TypeScript style guidelines.
Added request and response handling for the file upload endpoint in FilesController. Implemented form data parsing, header validation, and admin-specific parameter management. These changes aim to improve error handling and prepare the logic needed for saving files and associated data.
Introduces a new InsertAdminState guard to verify if the user is an admin by checking their authentication token and updating a custom header 'is_admin' accordingly. This guard fetches user details from the database and sets the 'is_admin' header to true or false based on the user's admin status.
Replaced the variable assignment and logging with a streamlined return statement for better code readability and performance. This change improves the method's efficiency by reducing unnecessary steps and directly returning the result.
Added a search method in FilesService and corresponding endpoint in FilesController to search files with a limit, offset, and search keyword. Introduced CreateFilesDto with validation constraints to structure file creation inputs.
This change introduces a constructor to the MachinesService class, ensuring the DbService is properly injected. This setup prepares for future methods dealing with machine data operations, such as fetching, creating, and deleting machines, as well as retrieving associated files.
The uploader field in the schema has been deleted. This change ensures the table structure is simplified and aligns with the updated data requirements. All related functionalities have been adjusted to accommodate this deletion.
Implemented placeholders for saving a file in the files service and added a new POST endpoint in the files controller. These changes lay the groundwork for future development of file uploading functionality.
Introduced CreateGroupDto to enforce validation rules for group creation. Integrated DbModule into GroupsService and added a getGroupsByName method for database queries. Placeholder methods for group creation, deletion and file retrieval are also defined.
Updated the FilesService.get() method to return a StreamableFile directly with appropriate headers instead of a custom object. Adjusted the FilesController to reflect this change and ensure the file names are formatted by replacing spaces with underscores.
Replace loop-based MIME type check with Set.prototype.has for improved readability and performance. This change eliminates the need for an explicit loop, making the code more concise and efficient.
Introduce 'extension' and 'isDocumentation' fields to the database schema. These additions enhance file metadata and facilitate improved data management.
This commit updates the FilesModule to import both StorageModule and DbModule. This enhances the functionality of the FilesModule by integrating database and storage services.
Replaced Buffer with StreamableFile for more efficient file handling by streaming the content instead of reading it into memory. Additionally, updated the method signatures and parameters to improve clarity and align with the new changes.
Removed the `files.service.spec.ts` test file as it is no longer required. Updated the `get` method parameter in `files.service.ts` to use `fileId` instead of `checksum`, and adjusted the related logic for consistency.
Implemented a method to fetch a file and its information based on checksum. Integrated database and storage services to retrieve and prepare file stream and metadata. Also handles scenarios where the file is not found or multiple entries exist for the same checksum.
Introduced a new `read` method in `storage.service.ts` to fetch files from storage based on checksum, extension, and type. This method handles potential exceptions by throwing a `NotFoundException` if the file is not found.
Enhanced the "new" method to include detailed documentation and parameters for file processing and validation. Introduced allowed MIME types as a parameter and logging for clearer file management.
Update all NestJS imports to use double quotes instead of single quotes across multiple files. Adjusted indentation in various files to ensure uniform code style. These changes improve code readability and maintainability.
Updated the Documentation button to include a NotepadTextDashed icon from lucide-react. This change improves visual consistency and enhances user experience by aligning with the icon usage pattern established in the Accueil button.
Deleted MachineController, MachineModule, and associated tests to streamline the codebase. This simplifies the project structure by removing unused or redundant components.
Reorganized StorageService to incorporate MIME type validation and adjustable file size limits, enhancing file validation. Introduced new methods for checksum calculation and file information generation, and updated the StorageModule to import the DbModule for database interactions.
Added a new 'checksum' field with a length of 64 characters to ensure data integrity. Additionally, enforced uniqueness on the 'type_name' to prevent duplicate entries.
Updated tsconfig.json to include paths for better imports. Modified layout.tsx and Header.tsx for improved styles. Refactored HomePage to use new state management and simplified components for better readability and navigation.
Updated `MachineModule` to `MachinesModule` and `AuthorModule` to `AuthorsModule` for consistency with pluralized naming. Adjusted import paths accordingly to reflect these changes.
Renamed MachineService to MachinesService across the codebase for consistency. Added MachinesController, MachinesModule, and associated tests to enhance modularity and structure.
Added dependencies include @nestjs/throttler, argon2, express, helmet, and jose. Updated existing dependencies in package.json and pnpm-lock.yaml to their latest versions for compatibility and security improvements.
This commit adds MachineModule and AuthorModule to the imports array in the AppModule. This inclusion ensures that the functionalities provided by these modules are available throughout the application.
Implemented the MachineModule along with its corresponding MachineController and MachineService classes. Added unit tests for both the controller and service to ensure they are correctly instantiated and defined.
This commit introduces a new Author module in the backend application. It includes the AuthorController with basic endpoints and the AuthorService for handling author-related logic. Basic test files for both the controller and the service are also added.
Implemented GET, POST, and DELETE endpoints in GroupsController to manage groups and associated files with pagination and optional search functionality. Created an ISearchQuery interface to standardize query parameters across methods.
This commit introduces the Files, Groups, and Admin modules, along with their respective services and controllers. Each module includes basic setup with injectable services, controllers, and initial test specs to ensure they are defined properly. This groundwork prepares the backend for further development and feature implementation.
Integrated FilesModule, AdminModule, and GroupsModule into app.module.ts to extend functionality. This addition enhances organizational capabilities and improves system modularity.
Added the `groupId` column to the existing table to link with the new `FilesGroupTable`. The `FilesGroupTable` includes a unique identifier and a unique group name to manage file groups effectively.