Repository navigation
feat: add document API endpoints to uteke-serve - #441
Merged
Merged
Conversation
Endpoints: - POST /doc/create — create/upsert document with optional parent - POST /doc/get — get document by id or slug - POST /doc/list — list documents (roots_only, parent filter) - POST /doc/search — hybrid/semantic/fts document search - POST /doc/move — move document to new parent - DELETE /doc/delete — delete document with cascade All endpoints accept namespace parameter. Added to startup banner.
- cli-reference.md: add doc search, move, --tree, --roots-only, --parent flags - cli-reference.md: add doc HTTP endpoints to API table - AGENT.md: add Function ↔ API ↔ CLI parity table for v0.4.0 - Document all 6 doc functions with corresponding CLI + API endpoints - Note breadcrumbs, descendants, export as CLI-only (intentional)
🔍 Cora AI Code Review❌ Blocked — critical issues found. 🔴 Error (4)
Review powered by cora-cli · BYOK · MIT |
| format!("document slug '{}' already exists", req_data.slug), | ||
| ) | ||
| } else if e.to_string().contains("maximum") | ||
| || e.to_string().contains("parent") |
| (Method::Post, "/doc/get") => match read_body::<DocGetRequest>(req.as_reader()) { | ||
| Ok(req_data) => match resolve_doc_id(&req_data) { | ||
| Ok(id_or_slug) => match uteke.doc_get(id_or_slug, ns(&req_data.namespace)) { | ||
| Ok(Some(doc)) => ctx.ok_response_for(req, &doc), |
| } | ||
| }, | ||
| Err(e) => ctx.error_response_for(req, 400, e), | ||
| }, |
| ns(&req_data.namespace), | ||
| req_data.limit, | ||
| &req_data.mode, | ||
| ) { |
This was referenced Jun 22, 2026
10 tasks
ajianaz
added a commit
that referenced
this pull request
Aug 13, 2026
* feat: add document API endpoints to uteke-serve Endpoints: - POST /doc/create — create/upsert document with optional parent - POST /doc/get — get document by id or slug - POST /doc/list — list documents (roots_only, parent filter) - POST /doc/search — hybrid/semantic/fts document search - POST /doc/move — move document to new parent - DELETE /doc/delete — delete document with cascade All endpoints accept namespace parameter. Added to startup banner. * docs: update cli-reference and AGENT.md for v0.4.0 doc API - cli-reference.md: add doc search, move, --tree, --roots-only, --parent flags - cli-reference.md: add doc HTTP endpoints to API table - AGENT.md: add Function ↔ API ↔ CLI parity table for v0.4.0 - Document all 6 doc functions with corresponding CLI + API endpoints - Note breadcrumbs, descendants, export as CLI-only (intentional) * fix: use correct parse_query_param function name in doc endpoints * fix: remove unused DocDeleteParams struct --------- Co-authored-by: ajianaz <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add HTTP API endpoints for all document operations in
uteke-serve, ensuring CLI and API feature parity.Endpoints Added
/doc/create/doc/get/doc/list/doc/search/doc/move/doc/delete?id=Request/Response Format
All POST endpoints accept JSON body. All endpoints accept
namespaceparameter.POST /doc/create
{ "slug": "guide", "content": "# Guide\n...", "title": "Guide", "tags": ["wiki"], "parent": "parent-slug", "namespace": "default" } → { "id": "uuid", "slug": "guide" }POST /doc/get
{ "id": "uuid" } or { "slug": "guide" } → { "id", "slug", "title", "content", "tags", "parent_id", "depth", "has_children", ... }POST /doc/list
{ "namespace": "default", "limit": 20, "roots_only": false, "parent": "parent-slug" } → [{ "id", "slug", "title", "depth", "has_children", ... }]POST /doc/search
{ "query": "authentication", "mode": "hybrid", "namespace": "default", "limit": 10 } → [{ "document": {...}, "chunk_heading", "chunk_snippet", "score", "mode" }]POST /doc/move
{ "id": "uuid", "new_parent": "new-parent-slug" } → { "moved": 1 }DELETE /doc/delete?id=uuid&namespace=default
→ { "deleted": true, "subtree_size": 3 }Changes
crates/uteke-server/src/main.rs: Added request structs, helper functions, 6 endpoint handlers, startup bannerCHANGELOG.md: Added v0.4.0 entry (includes hierarchical docs + doc search from PR feat: hierarchical documents with depth-10 tree engine + doc_search (#438 #440) #439)