fix(ci): fix black/ruff failures, add CoC and PR template
- Fix Python formatting (sync no longer strips blank lines from .py files) - Remove test_community_build.py (tests private sync module) - Fix ruff warnings in test files - Add CODE_OF_CONDUCT.md - Add .github/PULL_REQUEST_TEMPLATE.md Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -12,6 +12,7 @@ from typing import Any
|
||||
|
||||
from plugins.appwrite.client import AppwriteClient
|
||||
|
||||
|
||||
def get_tool_specifications() -> list[dict[str, Any]]:
|
||||
"""Return tool specifications for ToolGenerator (12 tools)"""
|
||||
return [
|
||||
@@ -316,10 +317,12 @@ def get_tool_specifications() -> list[dict[str, Any]]:
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
# =====================
|
||||
# HANDLER FUNCTIONS
|
||||
# =====================
|
||||
|
||||
|
||||
async def list_topics(
|
||||
client: AppwriteClient, queries: list[str] | None = None, search: str | None = None
|
||||
) -> str:
|
||||
@@ -334,6 +337,7 @@ async def list_topics(
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2)
|
||||
|
||||
|
||||
async def get_topic(client: AppwriteClient, topic_id: str) -> str:
|
||||
"""Get topic by ID."""
|
||||
try:
|
||||
@@ -343,6 +347,7 @@ async def get_topic(client: AppwriteClient, topic_id: str) -> str:
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2)
|
||||
|
||||
|
||||
async def create_topic(
|
||||
client: AppwriteClient, topic_id: str, name: str, subscribe: list[str] | None = None
|
||||
) -> str:
|
||||
@@ -358,6 +363,7 @@ async def create_topic(
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2)
|
||||
|
||||
|
||||
async def delete_topic(client: AppwriteClient, topic_id: str) -> str:
|
||||
"""Delete topic."""
|
||||
try:
|
||||
@@ -369,6 +375,7 @@ async def delete_topic(client: AppwriteClient, topic_id: str) -> str:
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2)
|
||||
|
||||
|
||||
async def create_subscriber(
|
||||
client: AppwriteClient, topic_id: str, subscriber_id: str, target_id: str
|
||||
) -> str:
|
||||
@@ -386,6 +393,7 @@ async def create_subscriber(
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2)
|
||||
|
||||
|
||||
async def delete_subscriber(client: AppwriteClient, topic_id: str, subscriber_id: str) -> str:
|
||||
"""Remove subscriber from topic."""
|
||||
try:
|
||||
@@ -398,6 +406,7 @@ async def delete_subscriber(client: AppwriteClient, topic_id: str, subscriber_id
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2)
|
||||
|
||||
|
||||
async def list_messages(
|
||||
client: AppwriteClient, queries: list[str] | None = None, search: str | None = None
|
||||
) -> str:
|
||||
@@ -416,6 +425,7 @@ async def list_messages(
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2)
|
||||
|
||||
|
||||
async def get_message(client: AppwriteClient, message_id: str) -> str:
|
||||
"""Get message by ID."""
|
||||
try:
|
||||
@@ -425,6 +435,7 @@ async def get_message(client: AppwriteClient, message_id: str) -> str:
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2)
|
||||
|
||||
|
||||
async def send_email(
|
||||
client: AppwriteClient,
|
||||
message_id: str,
|
||||
@@ -471,6 +482,7 @@ async def send_email(
|
||||
error_msg += " (Hint: Make sure you have configured an email provider in Appwrite)"
|
||||
return json.dumps({"success": False, "error": error_msg}, indent=2)
|
||||
|
||||
|
||||
async def send_sms(
|
||||
client: AppwriteClient,
|
||||
message_id: str,
|
||||
@@ -509,6 +521,7 @@ async def send_sms(
|
||||
error_msg += " (Hint: Make sure you have configured an SMS provider in Appwrite)"
|
||||
return json.dumps({"success": False, "error": error_msg}, indent=2)
|
||||
|
||||
|
||||
async def send_push(
|
||||
client: AppwriteClient,
|
||||
message_id: str,
|
||||
@@ -567,6 +580,7 @@ async def send_push(
|
||||
)
|
||||
return json.dumps({"success": False, "error": error_msg}, indent=2)
|
||||
|
||||
|
||||
async def delete_message(client: AppwriteClient, message_id: str) -> str:
|
||||
"""Delete message."""
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user