feat: complete public wiki and embedded previews

This commit is contained in:
吉鑫升 committed 2026-08-24 20:40:44 +08:00
1 parent bc49df4561
commit 30943159bf
18 files changed
+926 -48

No files matched your search

@@ -492,6 +492,31 @@ class WeKnoraClient:
raise WeKnoraError("WeKnora returned an invalid Wiki page")
return dict(value)
async def get_wiki_index(
self,
knowledge_base_id: str,
*,
types: Sequence[str],
limit: int = 50,
cursor: str = "",
) -> dict[str, Any]:
params: dict[str, Any] = {
"types": ",".join(value for value in types if value),
"limit": max(1, min(limit, 500)),
}
if cursor:
params["cursor"] = cursor
value = _data(
await self._request(
"GET",
f"/api/v1/knowledgebase/{quote(knowledge_base_id, safe='')}/wiki/index",
params=params,
)
)
if not isinstance(value, dict):
raise WeKnoraError("WeKnora returned an invalid Wiki index")
return dict(value)
async def create_wiki_page(self, knowledge_base_id: str, payload: Mapping[str, Any]) -> dict[str, Any]:
value = _data(
await self._request(