api/flake/list_history: init
Add an api endpoint to list the history of clan flakes that have been interacted with Also add `clan flake list`
This commit is contained in:
@@ -6,6 +6,7 @@ from typing import Annotated
|
||||
from fastapi import APIRouter, Body, HTTPException, status
|
||||
from pydantic import AnyUrl
|
||||
|
||||
from clan_cli import flakes
|
||||
from clan_cli.webui.api_inputs import (
|
||||
FlakeCreateInput,
|
||||
)
|
||||
@@ -50,6 +51,11 @@ async def add_flake(flake_dir: Path) -> None:
|
||||
await add.add_flake(flake_dir)
|
||||
|
||||
|
||||
@router.get("/api/flake/list_history", tags=[Tags.flake])
|
||||
async def list_flakes() -> list[Path]:
|
||||
return flakes.list_history.list_history()
|
||||
|
||||
|
||||
# TODO: Check for directory traversal
|
||||
@router.get("/api/flake/attrs", tags=[Tags.flake])
|
||||
async def inspect_flake_attrs(url: AnyUrl | Path) -> FlakeAttrResponse:
|
||||
|
||||
Reference in New Issue
Block a user