Skip to content

Commit e450c6e

Browse files
committed
chore: bump v0.2.2 — named entries, /sync/{identifier} endpoint
1 parent f588d8a commit e450c6e

4 files changed

Lines changed: 21 additions & 11 deletions

File tree

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
66

7+
## [0.2.2] - 2025-05-21
8+
9+
### Added
10+
11+
- `name` key for `.oikb.yaml` entries — use friendly names to target syncs via CLI (`--name wiki`) or API (`POST /sync/wiki`).
12+
13+
### Changed
14+
15+
- Daemon sync endpoint changed from `/sync/{source}` to `/sync/{identifier}` — accepts `name` or `kb-id` (UUIDs).
16+
717
## [0.2.1] - 2025-05-20
818

919
### Added

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "oikb"
3-
version = "0.2.1"
3+
version = "0.2.2"
44
description = "Sync anything to Open WebUI Knowledge Bases"
55
readme = "README.md"
66
authors = [

src/oikb/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ def sync(
333333

334334
# Filter by --name if specified.
335335
if name:
336-
entries = [e for e in entries if e.get("kb-id") == name or e.get("source") == name]
336+
entries = [e for e in entries if e.get("name") == name or e.get("kb-id") == name]
337337
if not entries:
338338
click.echo(click.style(f"No entry matching '{name}' in .oikb.yaml", fg="red"), err=True)
339339
sys.exit(1)

src/oikb/daemon.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ async def verify_api_key(
3838
app = FastAPI(
3939
title="oikb",
4040
description="Sync engine for Open WebUI Knowledge Bases. Trigger syncs, check status, and query history.",
41-
version="0.2.1",
41+
version="0.2.2",
4242
)
4343

4444
# Runtime state populated by start_daemon().
@@ -103,18 +103,18 @@ async def history_endpoint(
103103

104104

105105
@app.post(
106-
"/sync/{source}",
106+
"/sync/{identifier}",
107107
operation_id="trigger_sync",
108-
summary="Trigger an immediate sync for a source",
108+
summary="Trigger an immediate sync by alias or KB ID",
109109
dependencies=[Depends(verify_api_key)],
110110
)
111-
async def trigger_sync(source: str):
112-
"""Triggers an immediate sync for the given source or Knowledge Base ID. The sync runs asynchronously in the background. Use get_sync_status to check progress."""
111+
async def trigger_sync(identifier: str):
112+
"""Triggers an immediate sync matching the given alias or Knowledge Base ID. The sync runs asynchronously in the background. Use get_sync_status to check progress."""
113113
for entry in _entries:
114-
if entry.get("source") == source or entry.get("kb-id") == source:
114+
if entry.get("name") == identifier or entry.get("kb-id") == identifier:
115115
asyncio.create_task(_run_entry(entry))
116-
return {"triggered": True, "source": entry.get("source")}
117-
return {"triggered": False, "error": f"No entry matching '{source}'"}
116+
return {"triggered": True, "name": entry.get("name"), "kb_id": entry.get("kb-id")}
117+
return {"triggered": False, "error": f"No entry matching '{identifier}'"}
118118

119119

120120
# ── Scheduler ────────────────────────────────────────────────────
@@ -276,7 +276,7 @@ async def _startup():
276276
click.echo(f" {len(webhook_entries)} webhook-enabled source(s)")
277277
click.echo(f" GET http://localhost:{port}/health")
278278
click.echo(f" GET http://localhost:{port}/history")
279-
click.echo(f" POST http://localhost:{port}/sync/{{source}}")
279+
click.echo(f" POST http://localhost:{port}/sync/{{kb_id}}")
280280
if webhook_entries:
281281
click.echo(f" POST http://localhost:{port}/webhooks/github|gitlab|slack|confluence")
282282
click.echo(f"\n OpenAPI spec: http://localhost:{port}/openapi.json")

0 commit comments

Comments
 (0)