Versionen je Thema
Ein Thema hat Versionen storage/<Thema>/v<N>/ mit eigenem Lauf, Buch und Leseposition; bestehende Ablagen wandern beim Start nach v1/. Intern ist „Thema/vN“ der Schlüssel aller Zustandsfunktionen. API: ?v=N an allen Themen-Endpunkten, POST /version, DELETE ?v=N. Oberfläche: Versionsliste unter dem Thema (Klick auf Thema → Lauf der neuesten, auf Version → Buch), Knopf „Neue Version“ mit gleichen Eingaben. make loeschen kennt V=<Nr>. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
@@ -14,17 +14,19 @@ async function req(pfad, opts = {}) {
|
||||
}
|
||||
|
||||
const e = encodeURIComponent
|
||||
const q = (v) => (v ? `?v=${v}` : '') // Version; ohne Angabe die neueste
|
||||
export const api = {
|
||||
topics: () => req('/topics'),
|
||||
anlegen: (name, hinweise = '') => req('/topics', { method: 'POST', body: { name, hinweise } }),
|
||||
loeschen: (t) => req(`/topics/${e(t)}`, { method: 'DELETE' }),
|
||||
start: (t) => req(`/topics/${e(t)}/start`, { method: 'POST' }),
|
||||
pause: (t) => req(`/topics/${e(t)}/pause`, { method: 'POST' }),
|
||||
reset: (t) => req(`/topics/${e(t)}/reset`, { method: 'POST' }),
|
||||
state: (t) => req(`/topics/${e(t)}/state`),
|
||||
guide: (t) => req(`/topics/${e(t)}/guide`),
|
||||
position: (t) => req(`/topics/${e(t)}/position`),
|
||||
positionSetzen: (t, daten) => req(`/topics/${e(t)}/position`, { method: 'PUT', body: daten }),
|
||||
guideMdUrl: (t) => `/api/topics/${e(t)}/guide.md`,
|
||||
pdfUrl: (t) => `/api/topics/${e(t)}/buch.pdf`,
|
||||
versionAnlegen: (t) => req(`/topics/${e(t)}/version`, { method: 'POST' }),
|
||||
loeschen: (t, v) => req(`/topics/${e(t)}${q(v)}`, { method: 'DELETE' }),
|
||||
start: (t, v) => req(`/topics/${e(t)}/start${q(v)}`, { method: 'POST' }),
|
||||
pause: (t, v) => req(`/topics/${e(t)}/pause${q(v)}`, { method: 'POST' }),
|
||||
reset: (t, v) => req(`/topics/${e(t)}/reset${q(v)}`, { method: 'POST' }),
|
||||
state: (t, v) => req(`/topics/${e(t)}/state${q(v)}`),
|
||||
guide: (t, v) => req(`/topics/${e(t)}/guide${q(v)}`),
|
||||
position: (t, v) => req(`/topics/${e(t)}/position${q(v)}`),
|
||||
positionSetzen: (t, daten, v) => req(`/topics/${e(t)}/position${q(v)}`, { method: 'PUT', body: daten }),
|
||||
guideMdUrl: (t, v) => `/api/topics/${e(t)}/guide.md${q(v)}`,
|
||||
pdfUrl: (t, v) => `/api/topics/${e(t)}/buch.pdf${q(v)}`,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user