feat: lit/divi-insert and lit/divi-update

All-or-nothing at ability level (S39), duplicate ids refused (S14),
set and attrs on the same path refused (S38), invalid_attr_path error.

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-26 15:15:37 +02:00
co-authored by Claude Opus 5.5
parent b8cb01812e
commit 110beb7698
11 changed files with 711 additions and 5 deletions
+18
View File
@@ -101,6 +101,24 @@ final class Errors
return self::make('unsupported', $message, $hint, 400);
}
/**
* Unknown Divi attribute paths (spec §5.4, §8.2). $fields names every problem of the call,
* the unknown paths with their closest known ones.
*
* @param array<string, string> $fields Input path => problem.
*/
public static function invalidAttrPath(array $fields): WP_Error
{
return self::make(
'invalid_attr_path',
'Unbekannte Attributpfade; nichts wurde gespeichert.',
'Vorschläge unter fields prüfen; alle gültigen Pfade eines Moduls liefert lit/divi-catalog '
. '(direkt: lit-divi-catalog) mit module.',
400,
['fields' => $fields]
);
}
/**
* A write failed and was rolled back completely.
*