Commit Graph

6 Commits

Author SHA1 Message Date
Harry a285c70f52 refactor: clean up imports and improve code readability
- Removed unused imports in `__init__.py` and `dynamic_options.py`.
- Consolidated import statements in `github.py` and `issue_comment.py` for better organization.
- Standardized string formatting in test cases for consistency.
- Enhanced overall code clarity and maintainability.

These changes contribute to a cleaner codebase and improved readability across the project.
2025-09-08 23:55:31 +08:00
Harry 826a6df1a8 feat(trigger): enhance trigger validation and HTTP handling
- Updated `PluginExecutor` to return a result upon validating provider credentials.
- Renamed `ValidateProviderCredentials` to `ValidateTriggerCredentials` for consistency in trigger actions.
- Improved the `PluginRegistration` class to return OAuth schemas for registered providers.
- Added new error classes for better handling of trigger provider credential validation and OAuth errors.
- Refactored HTTP request and response serialization/deserialization for improved clarity and functionality.
- Enhanced GitHub provider to utilize new error handling and validation mechanisms.

This commit improves the overall structure and error management of the trigger system, ensuring better integration and usability.
2025-09-04 16:52:20 +08:00
Harry 9c431c21a1 test: fix import names after refactoring
- Update TriggerEvent import (was Trigger) in test_construct_trigger.py
- Update http_parser function imports to use new names:
  * serialize_request (was convert_request_to_raw_data)
  * serialize_response (was convert_response_to_raw_data)
  * deserialize_request (was parse_raw_request)
  * deserialize_response (was parse_raw_response)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-03 14:39:03 +08:00
Harry 1fa18bfd1c refactor(trigger): update trigger error handling and response types
- Renamed `WebhookValidationError` to `TriggerValidationError` for consistency in error handling across trigger operations.
- Updated references to the new `TriggerValidationError` in the GitHub provider and trigger interfaces.
- Enhanced the `TriggerProvider` class to raise the new validation error for webhook signature issues.
- Adjusted the `IssueCommentTrigger` to return the correct event response type.
- Improved type hints and imports in various modules for better clarity and organization.
2025-09-03 14:04:33 +08:00
Harry e9df3cbd4a feat(trigger): enhance trigger execution and response handling
- Introduced new response entities for trigger operations: TriggerInvokeResponse, TriggerDispatchResponse, TriggerSubscriptionResponse, TriggerUnsubscribeResponse, and TriggerRefreshResponse.
- Updated PluginExecutor methods to utilize the new response structures, improving clarity and consistency in trigger handling.
- Enhanced HTTP request parsing and response conversion utilities for better integration with various content types.
- Refactored GitHub provider to align with the updated trigger dispatch and subscription handling mechanisms.
2025-08-30 19:36:24 +08:00
Yeuoly 29a15ccdd7 feat(http_parser): add functions to parse raw HTTP requests and conve… (#119)
* feat(http_parser): add functions to parse raw HTTP requests and convert Request objects to raw data

- Implemented `parse_raw_request` to convert raw HTTP data into a Request object, including support for headers and body.
- Added `convert_request_to_raw_data` to transform a Request object back into raw HTTP data.
- Created unit tests for both functions to ensure correct parsing and conversion behavior.

* apply ruff
2025-04-27 15:02:42 +08:00