Report site health and pending translations through the API

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-01 08:32:45 +02:00
parent 5b46436641
commit 68c5bd4274
5 changed files with 316 additions and 0 deletions

View File

@@ -134,6 +134,8 @@ tags:
description: Who changed what and when, and undoing a change
- name: Reviews
description: Review, publication and preview links
- name: Health
description: What is wrong with the site, and what is left to translate
- name: Users
description: Local user administration
- name: Media
@@ -3527,6 +3529,66 @@ paths:
data: { $ref: "#/components/schemas/PreviewLinks" }
"403": { $ref: "#/components/responses/Forbidden" }
/v1/health:
get:
tags: [Health]
summary: Site health
description: |
The panel's health screen: every check the caller may see, problems
first — broken images, missing slugs, stale translations, unanswered
submissions… A check behind a permission the caller lacks is left out.
responses:
"200":
description: The findings
content:
application/json:
schema:
type: object
properties:
data:
type: array
items: { $ref: "#/components/schemas/HealthFinding" }
meta:
type: object
properties:
problems: { type: integer }
checked_at: { type: string, format: date-time }
"403": { $ref: "#/components/responses/Forbidden" }
/v1/translations/pending:
get:
tags: [Health]
summary: What is left to translate
description: |
Pages, projects, services and calls with a language still to write
(`missing`) or left behind by the one it was translated from (`stale`,
with since when). Unpaginated.
parameters:
- name: locale
in: query
description: "Only what this language lacks."
schema: { type: string }
- name: type
in: query
description: "`pages`, `projects`, `services` or `calls`."
schema: { type: string }
- name: published
in: query
description: "Only what is on the site \u2014 open, for calls."
schema: { type: boolean }
responses:
"200":
description: The records
content:
application/json:
schema:
type: object
properties:
data:
type: array
items: { $ref: "#/components/schemas/PendingTranslation" }
"422": { $ref: "#/components/responses/ValidationError" }
/v1/media:
get:
tags: [Media]
@@ -5277,6 +5339,26 @@ components:
links: { type: object, additionalProperties: { type: string, format: uri }, description: Language → link. }
expires_at: { type: string, format: date-time }
HealthFinding:
type: object
properties:
key: { type: string, example: missing-translations }
severity: { type: string, enum: [ok, warning, error] }
count: { type: integer }
title: { type: string }
description: { type: string }
samples: { type: array, items: { type: string }, description: Up to three examples. }
panel_url: { type: string, nullable: true, description: Where to fix it in the panel. }
PendingTranslation:
type: object
properties:
type: { type: string, enum: [pages, projects, services, calls] }
id: { type: integer }
title: { type: string }
missing: { type: array, items: { type: string }, description: Languages with nothing written. }
stale: { type: object, additionalProperties: { type: string, format: date-time }, description: Language → since when it has been behind. }
MediaFor:
type: string
enum: [pages, technologies, projects, members, clients, testimonials]