chore: bump dify_plugin version to 0.6.0b7 and update trigger event handling

- Updated the version in pyproject.toml from 0.6.0b6 to 0.6.0b7.
- Renamed trigger-related methods and classes for clarity, changing invoke_trigger to invoke_trigger_event and updating associated request and response classes.
- Adjusted event handling in the GithubTrigger class to improve event dispatching.

These changes ensure the plugin is up-to-date and enhance the clarity and functionality of event handling.
This commit is contained in:
Harry
2025-10-10 19:31:28 +08:00
parent fa3af0641d
commit d6fa7bfb7e
13 changed files with 549 additions and 28 deletions
@@ -41,9 +41,8 @@ class GithubTrigger(Trigger):
payload: Mapping[str, Any] = self._validate_payload(request)
response = Response(response='{"status": "ok"}', status=200, mimetype="application/json")
return EventDispatch(
events=[self._dispatch_trigger_event(event_type=event_type, payload=payload)], response=response
)
event: str = self._dispatch_trigger_event(event_type=event_type, payload=payload)
return EventDispatch(events=[event] if event else [], response=response)
def _dispatch_trigger_event(self, event_type: str, payload: Mapping[str, Any]) -> str:
event_type = event_type.lower()
@@ -54,7 +53,10 @@ class GithubTrigger(Trigger):
if event_type == "issue_comments":
return f"issue_comment_{action}"
raise TriggerDispatchError(f"Unsupported event type: {event_type}")
if event_type == "star":
return f"star_{action}"
return ""
def _validate_payload(self, request: Request) -> Mapping[str, Any]:
try: