api: Bildupload v1 unter Formular v2 (Pflichtfelder, Kennung des Wortlauts, Bestätigung mit Token), Legacy-Bildupload abgeschaltet, API-Doku (Bildkennzeichnung Block C)

- StorePressReleaseImageRequest: copyright, rights_confirmed, confirm_text_version Pflicht; 422 mit aktueller Kennung; 16 MiB
- PressReleaseImageController über den gemeinsamen Uploader, Löschen über den Remover; Resource mit Portalkennzeichnung, Kundenangabe, Herkunft, Bestätigung und warnings[]
- POST /service/pressreleases/{id}/images antwortet 410 mit Hinweis auf v1 (E-B4)
- API-Seite und Sprachdateien: Felder und Rechtehinweis mit aktiver Textkennung; Paritätsdokument ergänzt

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Kevin Adametz 2026-09-22 09:35:52 +00:00
parent 40953d6c65
commit 65ac72ce05
9 changed files with 411 additions and 30 deletions

View file

@ -56,13 +56,27 @@
['name' => 'no_export', 'type' => 'boolean', 'required' => false, 'desc' => __('static.api.field_no_export')],
];
$imageFields = [
['name' => 'image', 'type' => 'file', 'required' => true, 'desc' => __('static.api.field_image')],
// Bildkennzeichnung Block C: Mit Formular v2 sind Bildnachweis,
// Rechtebestätigung und die Kennung des Wortlauts Pflicht. Die Kennung
// kommt aus dem Textarchiv (aktive Fassung), damit die Doku nie hinterherhinkt.
$imageRightsV2 = (bool) config('images.rights_v2');
$confirmTextVersion = $imageRightsV2 ? app(\App\Services\Image\ImageRightsTextRenderer::class)->current()?->key : null;
$imageMaxMb = $imageRightsV2 ? (int) round((int) config('images.max_bytes') / 1024 / 1024) : 8;
$imageFields = array_values(array_filter([
['name' => 'image', 'type' => 'file', 'required' => true, 'desc' => __('static.api.field_image', ['mb' => $imageMaxMb])],
['name' => 'ai_declaration', 'type' => 'string', 'required' => true, 'desc' => __('static.api.field_image_ai_declaration')],
['name' => 'copyright', 'type' => 'string', 'required' => $imageRightsV2, 'desc' => __('static.api.field_image_copyright')],
$imageRightsV2 ? ['name' => 'rights_confirmed', 'type' => 'boolean', 'required' => true, 'desc' => __('static.api.field_image_rights_confirmed')] : null,
$imageRightsV2 ? ['name' => 'confirm_text_version', 'type' => 'string', 'required' => true, 'desc' => __('static.api.field_image_confirm_text_version', ['version' => $confirmTextVersion ?? '—'])] : null,
['name' => 'title', 'type' => 'string', 'required' => false, 'desc' => __('static.api.field_image_title')],
['name' => 'description', 'type' => 'string', 'required' => false, 'desc' => __('static.api.field_image_description')],
['name' => 'copyright', 'type' => 'string', 'required' => false, 'desc' => __('static.api.field_image_copyright')],
$imageRightsV2 ? ['name' => 'license_url', 'type' => 'string', 'required' => false, 'desc' => __('static.api.field_image_license_url')] : null,
$imageRightsV2 ? ['name' => 'source_url', 'type' => 'string', 'required' => false, 'desc' => __('static.api.field_image_source_url')] : null,
$imageRightsV2 ? ['name' => 'focus_x / focus_y', 'type' => 'integer', 'required' => false, 'desc' => __('static.api.field_image_focus')] : null,
$imageRightsV2 ? ['name' => 'no_crop', 'type' => 'boolean', 'required' => false, 'desc' => __('static.api.field_image_no_crop')] : null,
['name' => 'is_preview', 'type' => 'boolean', 'required' => false, 'desc' => __('static.api.field_image_is_preview')],
];
]));
$statusCodes = [
['code' => '200 / 201 / 204', 'desc' => __('static.api.status_2xx')],
@ -191,7 +205,11 @@ curl -X POST {{ $apiBase }}/press-releases/123/images \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-F "image=@pressefoto.jpg" \
-F "ai_declaration=original" \
-F "copyright=Mustermann GmbH" \
-F "copyright=Mustermann GmbH" \@if ($imageRightsV2)
-F "rights_confirmed=1" \
-F "confirm_text_version={{ $confirmTextVersion ?? 'img-confirm-v2' }}" \@endif
-F "is_preview=1"
{{ __('static.api.quickstart_step_3') }}
@ -202,6 +220,9 @@ curl -X POST {{ $apiBase }}/press-releases/123/submit \
</div>
<p class="text-[12px] text-ink-3 m-0 mt-3">
{{ __('static.api.ai_declaration_note') }}
@if ($imageRightsV2)
<p class="text-[13px] text-ink-2 m-0 mt-3 max-w-[760px]">{{ __('static.api.image_rights_note', ['version' => $confirmTextVersion ?? '—']) }}</p>
@endif
</p>
<p class="text-[12px] text-ink-3 m-0 mt-3">
{{ __('static.api.openapi_note') }} <a href="{{ route('docs.api.v1') }}" class="text-brand hover:underline">{{ __('static.api.openapi_link') }}</a>.