Buckets:

download
raw
1.65 kB
from fastapi import APIRouter, FastAPI, status
from fastapi.responses import JSONResponse
from src.api.services import PluginService
def get_router(app: FastAPI) -> APIRouter:
router = APIRouter()
@router.post("/list/", response_description="Return all plugins")
async def list_plugins():
success, result = await PluginService.list_plugins()
return JSONResponse(
status_code=status.HTTP_200_OK,
content={"success": success, "result": result},
)
@router.post("/{plugin_name}/", response_description="Install plugin")
async def install_plugin(plugin_name: str, plugin_url: str):
success, result = await PluginService.install_plugin(plugin_url, plugin_name)
return JSONResponse(
status_code=status.HTTP_200_OK,
content={"success": success, "result": result},
)
@router.delete("/{plugin_name}/", response_description="Uninstall plugin")
async def uninstall_plugin(plugin_name: str):
success, result = await PluginService.uninstall_plugin(plugin_name)
return JSONResponse(
status_code=status.HTTP_200_OK,
content={"success": success, "result": result},
)
@router.post(
"/check/{plugin_name}/",
response_description="Check if plugin is installed",
)
async def is_plugin_installed(plugin_name: str):
success, result = await PluginService.is_plugin_installed(plugin_name)
return JSONResponse(
status_code=status.HTTP_200_OK,
content={"success": success, "result": result},
)
return router

Xet Storage Details

Size:
1.65 kB
·
Xet hash:
c71d70ca868547421079d266aa757c29862fbed77bc5983e2106a4e61ebb0a56

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.