CI & Build / Python lint (push) Successful in 3s
CI & Build / Plugin hooks (push) Successful in 9s
CI & Build / integration (push) Successful in 25s
CI & Build / TypeScript typecheck (push) Successful in 32s
CI & Build / Python tests (push) Failing after 37s
CI & Build / Build & push image (push) Skipped
Reading the 28 route modules against each other and against the MCP tools: - routes/notes.py carried a PUT and a PATCH handler that were the same function minus the supersedes contract on one of them — one handler now serves both verbs, so both carry it. - The two _attach_supersession copies (REST + MCP) become supersession_svc.attach_relations(uid, note_id, data, hint=) — the seam the two surfaces must agree through; only the agent surface adds the one-sentence reading hint. - Three local _uid() wrappers over g.user.id → scribe.auth.get_current_user_id like every other module; design_systems' private _not_found → routes.utils. not_found; the four "********" literals → settings_svc.SECRET_MASK with the read/write contract written once. - routes/plugin.py: the project_id/repo resolution block and the comma-separated id parse were copied into three endpoints — _project_scope() and _int_list() now. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
31 lines
847 B
Python
31 lines
847 B
Python
"""Trash REST API — list / restore / purge soft-deleted content by batch."""
|
|
from __future__ import annotations
|
|
|
|
from quart import Blueprint, jsonify
|
|
|
|
from scribe.auth import get_current_user_id, login_required
|
|
import scribe.services.trash as trash_svc
|
|
|
|
trash_bp = Blueprint("trash", __name__, url_prefix="/api/trash")
|
|
|
|
|
|
|
|
@trash_bp.get("")
|
|
@login_required
|
|
async def list_trash():
|
|
return jsonify({"batches": await trash_svc.list_trash(get_current_user_id())})
|
|
|
|
|
|
@trash_bp.post("/<batch_id>/restore")
|
|
@login_required
|
|
async def restore_batch(batch_id: str):
|
|
n = await trash_svc.restore(get_current_user_id(), batch_id)
|
|
return jsonify({"restored": n})
|
|
|
|
|
|
@trash_bp.delete("/<batch_id>")
|
|
@login_required
|
|
async def purge_batch(batch_id: str):
|
|
n = await trash_svc.purge(get_current_user_id(), batch_id)
|
|
return jsonify({"purged": n})
|