Commit Graph

15 Commits

Author SHA1 Message Date
Yeuoly 76d1820205 feat: introduce UnsubscribeError for improved error handling in GitHub provider
- Added UnsubscribeError class to handle errors during unsubscribe operations, providing detailed error messages and codes.
- Updated GithubProvider to raise UnsubscribeError in various failure scenarios, enhancing error reporting and debugging.
- Minor adjustments in the IssuesTrigger class to prepare for future enhancements.

These changes improve the robustness of the GitHub trigger integration by ensuring clearer error management during webhook unsubscription processes.
2025-09-26 20:15:04 +08:00
Harry 26b1324c59 Merge remote-tracking branch 'origin/main' into feat/trigger
# Conflicts:
#	python/dify_plugin/core/entities/message.py
#	python/dify_plugin/core/entities/plugin/request.py
#	python/dify_plugin/core/entities/plugin/setup.py
#	python/dify_plugin/core/plugin_registration.py
#	python/dify_plugin/plugin.py
#	python/examples/github/tools/github_repositories.yaml
#	python/pyproject.toml
2025-09-26 14:18:06 +08:00
Harry c67ef57f10 feat(trigger): introduce new error class and enhance event payload handling
- Added `TriggerIgnoreEventError` to handle cases where events should be ignored based on filter criteria.
- Updated various GitHub trigger files to return relevant payload fields directly, improving data accessibility for event handling.
- Enhanced the handling of event filtering in triggers to ensure only relevant events are processed.

These changes improve the robustness and clarity of the GitHub trigger integration, allowing for better error management and data handling.
2025-09-19 13:17:59 +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 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
Harry ff61d5f204 feat(trigger): add subscribe and unsubscribe functionality to trigger provider 2025-08-27 14:37:19 +08:00
Harry 56db20fc40 Merge branch 'main' into feat/datasource
# Conflicts:
#	python/dify_plugin/core/plugin_executor.py
#	python/dify_plugin/core/runtime.py
#	python/dify_plugin/entities/__init__.py
#	python/dify_plugin/entities/agent.py
#	python/dify_plugin/entities/tool.py
#	python/dify_plugin/errors/tool.py
#	python/dify_plugin/integration/run.py
#	python/dify_plugin/interfaces/tool/__init__.py
#	python/dify_plugin/plugin.py
#	python/examples/github/manifest.yaml
#	python/examples/github/provider/github.py
#	python/examples/github/provider/github.yaml
#	python/examples/github/requirements.txt
#	python/examples/github/tools/github_repositories.py
#	python/examples/github/tools/github_repository_readme.py
#	python/pyproject.toml
2025-07-29 18:44:38 +08:00
Maries c6f83a63e1 feat[0.4.2]: Tool OAuth (#179)
* chore: fix ruff issue

* feat(oauth): implement OAuth

* feat(invoke-message): refactor message handling and introduce InvokeMessage class

* feat(plugin-oauth): add credential_id and credential_type to tool parameters

* feat(plugin-oauth): add credential_id and credential_type to tool parameters

* chore: update dify_plugin version to 0.5.0b4 and clean up github.yaml

* chore: update plugin version to 0.1.2 in manifest.yaml

* feat(session): session context and tool backwards invocation credential support

* feat(oauth): session context and tool backwards invocation credential support

* feat: update README and requirements for OAuth support in version 0.4.2

* feat: add .gitignore to exclude IDE files and secret keys

* chore: apply ruff

* feat: bump version to 0.4.2b1

* feat: update GitHub plugin configuration for OAuth support and improve credential handling

* feat: update .gitignore to exclude dify plugin files and public keys

* feat: fix credential validation for GitHub API and bump version to 0.2.1

* feat: update GitHub plugin to support multiple access tokens and bump version to 0.2.5

* chore: apply ruff

* feat: add ToolProviderOAuthError for improved OAuth error handling in GitHub plugin

* chore: apply ruff

* chore: bump version to 0.4.2

* chore: update examples sdk version to 0.4.2

* fix: thread deadlock in PluginRunner when running tests without gevent monkey patching

* feat: add support for refreshing OAuth credentials in Plugin and GitHub provider

* feat: refactor OAuth credential handling to return structured OAuthCredentials object

* apply ruff

* feat: refactor OAuth credential handling to use ToolOAuthCredentials for improved structure

* feat: reorganize imports in __init__.py for improved clarity and structure

* feat: add Microsoft To Do plugin for refresh token example

* chore: apply ruff

* fix: update author in GitHub configuration and clean up Microsoft To Do schema

* chore: bump version to 0.4.2b2 in pyproject.toml

* feat: update Microsoft To Do plugin to handle OAuth token encoding and version bump

* feat:remove inelegant example

* chore: update dify_plugin version to 0.4.2

* chore: bump version to 0.4.2 in pyproject.toml

---------

Co-authored-by: Yeuoly <admin@srmxy.cn>
2025-07-23 13:49:01 +08:00
Harry 6bf1431954 feat: enhance type hints and improve error handling in Notion datasource 2025-07-18 20:04:46 +08:00
Harry a844db7a68 refactor: streamline code by improving import order and simplifying function definitions 2025-07-02 16:32:20 +08:00
Harry e8cc4760cb refactor: update type hints to use union syntax and improve import order 2025-07-02 16:15:28 +08:00
-LAN- 5858fe715e chore: Apply formet and auto fix
Signed-off-by: -LAN- <laipz8200@outlook.com>
2024-12-02 21:10:36 +08:00
Yeuoly 2a66ffe085 fix: transform generic error into correct type 2024-09-29 13:49:42 +08:00
takatost 77c25eaaa3 refactor all 2024-09-03 23:03:15 +08:00