feat: content-create and content-update with schema validation

All-or-nothing writes: validation (fields, terms, featured image, parent,
template) before any write; failed extras delete the new draft (create) or
restore revision, old columns, fields, terms and featured image (update).
content-update requires rev; Rev::ofPost covers content, title, excerpt,
status and post_modified_gmt. MetaFieldSource::write() now throws on failure.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01At3V6SjwbMe6eMzVGW3Hs7
This commit is contained in:
2026-09-25 23:01:48 +02:00
co-authored by Claude Opus 5.5
parent b9d46f3cec
commit 4f9a47fe32
15 changed files with 1355 additions and 9 deletions
@@ -68,7 +68,7 @@ final class PostPresenterTest extends TestCase
self::assertSame(['role' => 'Leitung'], $full['fields']);
self::assertSame(['id' => 33, 'url' => 'https://kunde.de/wp-content/uploads/foto.jpg', 'alt' => 'Porträt'], $full['featured_image']);
self::assertSame(['id' => 2, 'name' => 'Jan'], $full['author']);
self::assertSame(Rev::of('<p>Hallo</p>'), $full['rev']);
self::assertSame(Rev::ofPost($post), $full['rev']);
self::assertSame([], $full['hints']);
}
@@ -90,7 +90,7 @@ final class PostPresenterTest extends TestCase
self::assertStringContainsString('lit-divi-outline', $full['hints'][0]);
self::assertInstanceOf(stdClass::class, $full['terms']);
self::assertInstanceOf(stdClass::class, $full['fields']);
self::assertSame(Rev::of('<!-- wp:divi/section /-->'), $full['rev']);
self::assertSame(Rev::ofPost($post), $full['rev']);
}
public function testPasswordAndProtectedReadonlyMetaFieldsAreOmitted(): void