Adds API docs annotations & generator (#927)

* initial commit

* fixes category api route

* fixes follow api routes

---------

Co-authored-by: Christian Beutel <>
This commit is contained in:
Flomp
2026-04-18 17:04:49 +02:00
committed by GitHub
parent da38cfc19a
commit b7b16e5a6e
91 changed files with 18668 additions and 37201 deletions

View File

@@ -23,37 +23,6 @@ export async function users_create(user: User) {
return createdUser;
}
export async function users_search(q: string, includeSelf: boolean = true) {
const user = get(currentUser)
let r = await fetch('/api/v1/user/anonymous?' + new URLSearchParams({
"filter": `username~"${q}"${includeSelf ? '' : `&&id!="${user?.id}"`}`,
}), {
method: 'GET',
})
if (!r.ok) {
const response = await r.json();
throw new APIError(r.status, response.message, response.detail)
}
const response = await r.json()
return response.items;
}
export async function users_show(id: string, f: (url: RequestInfo | URL, config?: RequestInit) => Promise<Response> = fetch) {
let r = await f(`/api/v1/user/anonymous/${id}`, {
method: 'GET',
})
if (!r.ok) {
const response = await r.json();
throw new APIError(r.status, response.message, response.detail)
}
const response: UserAnonymous = await r.json()
return response;
}
export async function users_auth_methods(f: (url: RequestInfo | URL, config?: RequestInit) => Promise<Response> = fetch): Promise<AuthMethodsList> {
const r = await f('/api/v1/auth/oauth', {
method: 'GET',