Commit graph

2993 commits

Author SHA1 Message Date
Max
7977b7f48e Remove signin module and refactor OpenAPI to eliminate signin dependencies
- Deleted the entire signin module, including related files and configurations, to streamline the authentication process.
- Updated OpenAPI to remove references to signin, including the loading of signin configurations and associated handlers.
- Refactored user authentication routes to integrate captcha functionality directly within the user module, enhancing user experience and security.
- Adjusted routing structure to reflect the removal of signin, ensuring clarity and consistency in user management operations.
2025-09-22 11:04:00 +08:00
Max
ad57e18d1b
Merge pull request #1153 from trheyi/main
Refactor login cookie handling to improve security and organization
2025-09-18 10:11:49 +08:00
Max
6f3a57cb33 Refactor login cookie handling to improve security and organization
- Consolidated cookie management into a new SendLoginCookies function, which sends access token, refresh token, and session ID cookies with appropriate security settings.
- Updated authback functions in the signin and oauth files to utilize the new SendLoginCookies function, enhancing code clarity and reducing duplication.
2025-09-18 10:10:58 +08:00
Max
b251d507dc
Merge pull request #1152 from trheyi/main
Fix formatting in OAuth authorization test for improved readability
2025-09-18 09:11:33 +08:00
Max
54d7120626 Fix formatting in OAuth authorization test for improved readability
- Removed unnecessary blank line in TestUserOAuthAuthorizationURLParameters to enhance code clarity and maintain consistency in test formatting.
2025-09-18 09:11:09 +08:00
Max
e8734849c2
Merge pull request #1151 from trheyi/main
Add user configuration loading and update authentication routes
2025-09-18 09:03:38 +08:00
Max
a6e1f6e382 Add user configuration loading and update authentication routes
- Integrated user configuration loading in the OpenAPI server initialization to enhance user management capabilities.
- Migrated authentication routes from /signin to /login, updating handler functions for clarity and consistency.
- Adjusted OAuth provider routes to reflect new paths, improving the overall routing structure for user authentication.
2025-09-18 09:02:54 +08:00
Max
8f1e3a27a3
Merge pull request #1150 from trheyi/main
Update MFA endpoint naming in API documentation and routing
2025-09-17 10:02:25 +08:00
Max
c5ea4dbfe8 Update MFA endpoint naming in API documentation and routing
- Renamed 2FA references to MFA in the user management API documentation and routing structure for consistency and clarity.
- Adjusted README to reflect the new endpoint paths for TOTP and SMS MFA functionalities.
2025-09-17 10:01:54 +08:00
Max
c4a1f7040b
Merge pull request #1149 from trheyi/main
Refactor user management API documentation and routing structure
2025-09-17 09:56:06 +08:00
Max
88efa1bc99 Refactor user management API documentation and routing structure
- Updated README to reflect changes in user management APIs, renaming balance management to credits management and updating endpoints accordingly.
- Enhanced team management section with detailed CRUD operations and member management, including invitation handling.
- Refactored user.go to align with new API structure, replacing balance with credits and invite management with referral management, while adding invitation response handling.
2025-09-17 09:55:35 +08:00
Max
aeeeaa6ed8
Merge pull request #1148 from trheyi/main
Add user and team handler attachments to OpenAPI server
2025-09-17 09:43:04 +08:00
Max
3f5e0caef8 Add user and team handler attachments to OpenAPI server
- Integrated user and team handler functions into the OpenAPI server's routing structure.
- Established new routes for user and team management under the OpenAPI framework, enhancing the server's capabilities for handling user-related operations.
2025-09-17 09:42:35 +08:00
Max
f78af80014
Merge pull request #1147 from trheyi/main
Refactor invitation handling and data parsing in user provider
2025-09-16 17:55:26 +08:00
Max
6c73395158 Refactor invitation handling and data parsing in user provider
- Updated TestMemberInvitationExpiry to use a consistent expired time for invitations.
- Simplified invitation expiration check in AcceptInvitation by utilizing a new checkTimeExpired function.
- Enhanced member ID parsing in AcceptInvitation to handle potential errors more gracefully.
- Refactored total extraction logic in CountOAuthAccounts, CountRoles, CountTeams, CountTypes, and CountUsers to use a new utility function for improved clarity and consistency.
- Introduced parseTimeFromDB and parseIntFromDB functions to streamline data parsing from database fields.
2025-09-16 17:54:56 +08:00
Max
4a2eab202b
Merge pull request #1146 from trheyi/main
Add team and member management capabilities to user provider
2025-09-16 17:34:12 +08:00
Max
b20ddee701 Add team and member management capabilities to user provider
- Introduced new constants for team and member error handling, enhancing error reporting.
- Added default field lists for teams and members, improving data structure organization.
- Expanded the UserProvider interface with methods for team and member management, including creation, updates, and retrieval.
- Enhanced the NewDefaultUser function to support team and member configurations, ensuring flexibility in user management.
2025-09-16 17:33:25 +08:00
Max
acc9527e05
Merge pull request #1145 from trheyi/main
Enhance member model to support robot members and their configurations
2025-09-16 10:00:42 +08:00
Max
a2df75b6e2 Enhance member model to support robot members and their configurations
- Updated the member model to include a new member_type field, allowing differentiation between human and robot members.
- Added fields specific to robot members, including robot_name, robot_description, and robot_avatar, to capture essential information.
- Introduced robot configuration fields such as robot_config, agents, tools, and data_access_permissions for enhanced functionality.
- Implemented scheduling and automation features for robots, including is_active_robot, schedule_config, and activity_frequency.
- Enhanced indexing to support efficient queries for robot members and their activities, improving overall system performance.
2025-09-16 10:00:04 +08:00
Max
c145a14606
Merge pull request #1144 from trheyi/main
Refactor user and model structures to enhance organization and role m…
2025-09-16 09:36:30 +08:00
Max
580f3683e2 Refactor user and model structures to enhance organization and role management
- Reorganized models by replacing the assistant and chat models with a new agent structure, including assistant, chat, and history models.
- Updated user model relationships to reflect changes in role and type references, ensuring consistency with the new model structure.
- Removed obsolete organization and user role models, streamlining the overall architecture.
- Adjusted system model mappings to incorporate new member and role models, enhancing clarity in user management.
2025-09-16 09:35:18 +08:00
Max
46c24178d0
Merge pull request #1143 from trheyi/main
Enhance Provider struct to include Label field for improved provider …
2025-09-12 18:51:00 +08:00
Max
426fec1608 Enhance Provider struct to include Label field for improved provider identification
- Added Label field to the Provider struct in types.go to allow for better identification of third-party login providers.
- Updated createPublicConfig function in signin.go to populate the new Label field when creating public provider configurations.
2025-09-12 18:50:28 +08:00
Max
82a2e55bd4
Merge pull request #1142 from trheyi/main
Add organization_user model and enhance relationships in existing models
2025-09-04 17:33:17 +08:00
Max
5a23afb22c Add organization_user model and enhance relationships in existing models
- Introduced the organization_user model to manage relationships between organizations and users.
- Updated organization and user models to include new relationships for managing memberships and ownerships.
- Refactored system and test model mappings to incorporate the new organization_user model, ensuring consistency across the application.
2025-09-04 17:32:39 +08:00
Max
e4620aec0b
Merge pull request #1141 from trheyi/main
Add organization model and enhance user model indexing
2025-09-04 17:17:42 +08:00
Max
d9c593728e Add organization model and enhance user model indexing
- Introduced the organization model with associated data structure and methods for asset management.
- Updated user model to include new indexing on locale and zoneinfo for improved internationalization queries.
- Refactored system and test model mappings to include the new organization model, ensuring consistency across the application.
2025-09-04 17:17:16 +08:00
Max
ebdc9e916a
Merge pull request #1140 from trheyi/main
Initialize job package with health checker and data cleaner
2025-09-04 09:57:25 +08:00
Max
e38e1e0673 Initialize job package with health checker and data cleaner
- Added init function to set up health checker and data cleaner on package initialization.
- Implemented health checker with configurable interval and logging for status updates.
- Introduced data cleaner with a default retention period and logging for its operations.
- Added functions to stop and restart both health checker and data cleaner, enhancing control over their lifecycle.
2025-09-04 09:56:58 +08:00
Max
c98745dec9
Merge pull request #1139 from trheyi/main
Add keywords filter to ListJobs function for enhanced job search
2025-09-03 08:06:56 +08:00
Max
e3d7d049cc Add keywords filter to ListJobs function for enhanced job search
- Implemented a keywords filter in the ListJobs function to allow searching by job name and description.
- Refactored enabled status handling to support multiple truthy and falsy values, improving flexibility in job retrieval.
- Default behavior remains to show all records regardless of enabled status, ensuring no data is inadvertently filtered out.
2025-09-03 08:06:33 +08:00
Max
d1da306fad
Merge pull request #1138 from trheyi/main
Enhance job management and category handling
2025-09-02 18:37:53 +08:00
Max
71f7dcbbad Enhance job management and category handling
- Introduced field lists for job, category, execution, and log queries to streamline data retrieval.
- Updated ListJobs, GetJob, GetCategories, and ListLogs functions to utilize new field lists for improved query efficiency.
- Enhanced job creation logic to set default values for enabled status, ensuring new jobs are active by default.
- Added category name resolution in job retrieval, enriching job data with associated category names.
- Improved error handling and logging throughout job and category management processes for better traceability.
2025-09-02 18:36:14 +08:00
Max
1f1c6b0018
Merge pull request #1137 from trheyi/main
Enhance job and category management with unique ID generation
2025-09-02 16:58:03 +08:00
Max
58f830b7b6 Enhance job and category management with unique ID generation
- Introduced unique ID generation for jobs, categories, and executions using gonanoid, improving ID handling and reducing collisions.
- Updated SaveJob and SaveCategory functions to utilize new ID generation methods, ensuring consistent and unique identifiers.
- Enhanced job creation logic to allow for category name handling, enabling automatic category ID assignment based on provided names.
- Refactored ensureCategoryExists to check for existing categories by name, streamlining category management during job operations.
- Improved error handling and logging for ID generation and category retrieval processes, ensuring better traceability and reliability.
2025-09-02 16:57:23 +08:00
Max
783ab7256e
Merge pull request #1136 from trheyi/main
Refactor document processing functions to improve job handling
2025-09-02 10:17:28 +08:00
Max
15661ca0a1 Refactor document processing functions to improve job handling
- Updated job execution identifiers in AddFileAsync, AddTextAsync, and AddURLAsync to use more descriptive names.
- Removed obsolete async processing functions for file, text, and URL, streamlining the codebase.
- Enhanced the registration of document processing handlers in the knowledge base initialization, ensuring clarity and consistency.
2025-09-02 10:16:41 +08:00
Max
c34e08abf2
Merge pull request #1135 from trheyi/main
Refactor job handling and enhance document processing features
2025-09-02 10:07:16 +08:00
Max
455ed57231 Refactor job handling and enhance document processing features
- Renamed the Start method to Push for better semantic clarity in job execution.
- Introduced OnceAndSave, CronAndSave, and DaemonAndSave methods for immediate job creation and saving.
- Added new test cases for OnceAndSave, CronAndSave, and DaemonAndSave methods to ensure proper functionality.
- Updated AddFileProcess, AddTextProcess, and AddURLProcess to utilize new job handling methods, improving consistency across document operations.
- Enhanced error handling and logging in document processing functions for better traceability.
2025-09-02 10:05:51 +08:00
Max
9679a96576
Merge pull request #1134 from trheyi/main
Enhance execution handling and improve time field processing
2025-09-01 13:04:36 +08:00
Max
41ed9038d9 Enhance execution handling and improve time field processing
- Updated the GetExecutions function to order by created_at instead of started_at for better accuracy in execution retrieval.
- Added a new utility function getMapKeys for debugging purposes.
- Enhanced SaveExecution to ensure JSON fields are stored as strings for SQLite compatibility.
- Improved time field processing in mapToStruct to support multiple formats, ensuring better compatibility with different databases.
- Removed unnecessary sleep in TestJobExecution to streamline test execution.
2025-09-01 13:04:05 +08:00
Max
137c5fb6df
Merge pull request #1133 from trheyi/main
Fix formatting inconsistencies in test files by removing unnecessary …
2025-09-01 12:32:54 +08:00
Max
2c541adbbb Fix formatting inconsistencies in test files by removing unnecessary blank lines
- Cleaned up the TestJobCRUD, TestCategoryCRUD, and TestLogCRUD functions in data_test.go by removing extra blank lines, improving code readability and consistency.
2025-09-01 12:32:33 +08:00
Max
3a0d7648c2
Merge pull request #1132 from trheyi/main
Enhance job execution and management features
2025-09-01 12:27:34 +08:00
Max
a1869726d5 Enhance job execution and management features
- Implemented execution options to allow priority settings and shared data for job executions.
- Introduced new execution types for processes and commands, improving flexibility in job handling.
- Updated job and execution models to include new fields for execution options and priority.
- Refactored job submission logic to support context-aware execution, enhancing error handling and process management.
- Improved test coverage for job execution scenarios, ensuring robust validation of new features.
2025-09-01 12:26:29 +08:00
Max
4ba2200d78 Update test error handling to use t.Fatal for critical execution checks
- Changed instances of t.Error to t.Fatal in job test files to ensure immediate test termination when no executions are found, improving test reliability and clarity.
2025-08-31 19:02:31 +08:00
Max
2a8aafb64f
Merge pull request #1131 from trheyi/main
Refactor error handling in category retrieval test and enhance time f…
2025-08-31 16:25:44 +08:00
Max
5612fb58e2 Refactor error handling in category retrieval test and enhance time field processing
- Updated the test for category retrieval to use t.Fatal instead of t.Error for critical failures, ensuring immediate test termination on error.
- Refactored the mapToStruct function to improve handling of boolean and time fields, converting database time formats to RFC3339 and ensuring proper type conversions for specific keys.
2025-08-31 16:25:12 +08:00
Max
95f957d477
Merge pull request #1130 from trheyi/main
Refactor job and category saving logic to improve ID handling
2025-08-31 15:58:29 +08:00
Max
e2d8ef551f Refactor job and category saving logic to improve ID handling
- Updated SaveJob and SaveCategory functions to remove the ID field from data before saving, allowing the database to auto-increment IDs.
- Changed references from "id" to "job_id" and "category_id" in query parameters to align with the new ID handling.
- Enhanced SaveLog function to always create a new log entry, ensuring consistent handling of log data.
- Updated SaveExecution function to follow the same ID handling pattern as job and category saving.
2025-08-31 15:57:28 +08:00