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:
@@ -13,6 +13,7 @@ from typing import Any
|
||||
|
||||
from plugins.appwrite.client import AppwriteClient
|
||||
|
||||
|
||||
def get_tool_specifications() -> list[dict[str, Any]]:
|
||||
"""Return tool specifications for ToolGenerator (18 tools)"""
|
||||
return [
|
||||
@@ -425,10 +426,12 @@ def get_tool_specifications() -> list[dict[str, Any]]:
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
# =====================
|
||||
# HANDLER FUNCTIONS
|
||||
# =====================
|
||||
|
||||
|
||||
async def list_databases(
|
||||
client: AppwriteClient, queries: list[str] | None = None, search: str | None = None
|
||||
) -> str:
|
||||
@@ -447,6 +450,7 @@ async def list_databases(
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2)
|
||||
|
||||
|
||||
async def get_database(client: AppwriteClient, database_id: str) -> str:
|
||||
"""Get database by ID."""
|
||||
try:
|
||||
@@ -456,6 +460,7 @@ async def get_database(client: AppwriteClient, database_id: str) -> str:
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2)
|
||||
|
||||
|
||||
async def create_database(
|
||||
client: AppwriteClient, database_id: str, name: str, enabled: bool = True
|
||||
) -> str:
|
||||
@@ -475,6 +480,7 @@ async def create_database(
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2)
|
||||
|
||||
|
||||
async def update_database(
|
||||
client: AppwriteClient, database_id: str, name: str, enabled: bool | None = None
|
||||
) -> str:
|
||||
@@ -490,6 +496,7 @@ async def update_database(
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2)
|
||||
|
||||
|
||||
async def delete_database(client: AppwriteClient, database_id: str) -> str:
|
||||
"""Delete database."""
|
||||
try:
|
||||
@@ -501,6 +508,7 @@ async def delete_database(client: AppwriteClient, database_id: str) -> str:
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2)
|
||||
|
||||
|
||||
async def list_collections(
|
||||
client: AppwriteClient,
|
||||
database_id: str,
|
||||
@@ -525,6 +533,7 @@ async def list_collections(
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2)
|
||||
|
||||
|
||||
async def get_collection(client: AppwriteClient, database_id: str, collection_id: str) -> str:
|
||||
"""Get collection details."""
|
||||
try:
|
||||
@@ -534,6 +543,7 @@ async def get_collection(client: AppwriteClient, database_id: str, collection_id
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2)
|
||||
|
||||
|
||||
async def create_collection(
|
||||
client: AppwriteClient,
|
||||
database_id: str,
|
||||
@@ -566,6 +576,7 @@ async def create_collection(
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2)
|
||||
|
||||
|
||||
async def update_collection(
|
||||
client: AppwriteClient,
|
||||
database_id: str,
|
||||
@@ -594,6 +605,7 @@ async def update_collection(
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2)
|
||||
|
||||
|
||||
async def delete_collection(client: AppwriteClient, database_id: str, collection_id: str) -> str:
|
||||
"""Delete collection."""
|
||||
try:
|
||||
@@ -606,6 +618,7 @@ async def delete_collection(client: AppwriteClient, database_id: str, collection
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2)
|
||||
|
||||
|
||||
async def list_attributes(
|
||||
client: AppwriteClient, database_id: str, collection_id: str, queries: list[str] | None = None
|
||||
) -> str:
|
||||
@@ -628,6 +641,7 @@ async def list_attributes(
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2)
|
||||
|
||||
|
||||
async def create_string_attribute(
|
||||
client: AppwriteClient,
|
||||
database_id: str,
|
||||
@@ -664,6 +678,7 @@ async def create_string_attribute(
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2)
|
||||
|
||||
|
||||
async def create_integer_attribute(
|
||||
client: AppwriteClient,
|
||||
database_id: str,
|
||||
@@ -700,6 +715,7 @@ async def create_integer_attribute(
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2)
|
||||
|
||||
|
||||
async def create_boolean_attribute(
|
||||
client: AppwriteClient,
|
||||
database_id: str,
|
||||
@@ -732,6 +748,7 @@ async def create_boolean_attribute(
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2)
|
||||
|
||||
|
||||
async def delete_attribute(
|
||||
client: AppwriteClient, database_id: str, collection_id: str, key: str
|
||||
) -> str:
|
||||
@@ -745,6 +762,7 @@ async def delete_attribute(
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2)
|
||||
|
||||
|
||||
async def list_indexes(
|
||||
client: AppwriteClient, database_id: str, collection_id: str, queries: list[str] | None = None
|
||||
) -> str:
|
||||
@@ -767,6 +785,7 @@ async def list_indexes(
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2)
|
||||
|
||||
|
||||
async def create_index(
|
||||
client: AppwriteClient,
|
||||
database_id: str,
|
||||
@@ -795,6 +814,7 @@ async def create_index(
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2)
|
||||
|
||||
|
||||
async def delete_index(
|
||||
client: AppwriteClient, database_id: str, collection_id: str, key: str
|
||||
) -> str:
|
||||
|
||||
Reference in New Issue
Block a user