Close the last gaps in the API documentation
The image endpoint, the spec itself and the scheduled publishing run were missing from the spec and the admin page.
This commit is contained in:
+13
@@ -210,6 +210,19 @@ curl -s -X DELETE -H "Authorization: Bearer $TOKEN" \
|
||||
|
||||
Liefert eine Variante aus. Die Pfade stehen am Medium unter `variants`, je Eintrag mit `width`, `format` und `path`.
|
||||
|
||||
## Zeitsteuerung
|
||||
|
||||
### POST /api/v1/publish-due
|
||||
|
||||
Veröffentlicht alle Beiträge, deren Termin erreicht ist. Der Aufruf gehört einer Zeitsteuerung, nicht einem Zugang, und verlangt `CRON_SECRET` als Bearer-Token.
|
||||
|
||||
```bash
|
||||
curl -s -X POST -H "Authorization: Bearer $CRON_SECRET" \
|
||||
http://localhost:4700/api/v1/publish-due
|
||||
```
|
||||
|
||||
Antwort: `{ "published": [...], "meta": { "total": 0 } }`.
|
||||
|
||||
## Werkzeuge
|
||||
|
||||
| Adresse | Inhalt |
|
||||
|
||||
@@ -274,6 +274,26 @@ export default async function AdminApiPage() {
|
||||
/>
|
||||
</section>
|
||||
|
||||
<section className="flex flex-col gap-5">
|
||||
<SectionLabel>Dateien und Zeitsteuerung</SectionLabel>
|
||||
|
||||
<ApiEndpoint
|
||||
method="GET"
|
||||
path="/api/v1/media/file/..."
|
||||
auth="read"
|
||||
summary="Liefert eine Bildfassung aus. Die Pfade stehen am Medium unter variants, je Eintrag mit width, format und path."
|
||||
example={'curl -s -H "Authorization: Bearer $TOKEN" \\\n http://localhost:4700/api/v1/media/file/<pfad>'}
|
||||
/>
|
||||
|
||||
<ApiEndpoint
|
||||
method="POST"
|
||||
path="/api/v1/publish-due"
|
||||
auth="CRON_SECRET"
|
||||
summary="Veröffentlicht alle Beiträge, deren Termin erreicht ist. Für eine Zeitsteuerung gedacht, nicht für Zugänge."
|
||||
example={'curl -s -X POST -H "Authorization: Bearer $CRON_SECRET" \\\n http://localhost:4700/api/v1/publish-due'}
|
||||
/>
|
||||
</section>
|
||||
|
||||
<section className="flex flex-col gap-4">
|
||||
<SectionLabel>Datum und Nummer</SectionLabel>
|
||||
<div className="flex max-w-read flex-col gap-4 text-pretty text-ink-2">
|
||||
|
||||
@@ -346,6 +346,36 @@ export function openApiDocument(baseUrl: string) {
|
||||
},
|
||||
},
|
||||
},
|
||||
'/api/v1/media/file/{path}': {
|
||||
get: {
|
||||
summary: 'Bilddatei ausliefern',
|
||||
description: 'Die Pfade stehen am Medium unter variants, je Eintrag mit width, format und path.',
|
||||
parameters: [{ name: 'path', in: 'path', required: true, schema: { type: 'string' } }],
|
||||
responses: {
|
||||
'200': { description: 'Bilddatei' },
|
||||
...errors([401, 404]),
|
||||
},
|
||||
},
|
||||
},
|
||||
'/api/v1/openapi.json': {
|
||||
get: {
|
||||
summary: 'Diese Beschreibung abrufen',
|
||||
responses: {
|
||||
'200': { description: 'OpenAPI-Dokument' },
|
||||
...errors([401]),
|
||||
},
|
||||
},
|
||||
},
|
||||
'/api/v1/publish-due': {
|
||||
post: {
|
||||
summary: 'Fällige Termine veröffentlichen',
|
||||
description: 'Für eine Zeitsteuerung gedacht, nicht für Zugänge. Verlangt CRON_SECRET als Bearer-Token.',
|
||||
responses: {
|
||||
'200': { description: 'Veröffentlichte Einträge' },
|
||||
...errors([401]),
|
||||
},
|
||||
},
|
||||
},
|
||||
'/api/v1/media/{id}': {
|
||||
delete: {
|
||||
summary: 'Bild löschen',
|
||||
|
||||
Reference in New Issue
Block a user