feat: Divi-Fähigkeiten (DiviFeature, Requirement, ConstantRequirement) an Call, Mirror und Manifest; alle acht Adapter getaggt; Tests für Vollständigkeit und die gepinnte Zuordnung

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Jan-Niclas Loosen
2026-10-18 21:59:43 +02:00
co-authored by Claude Sonnet 5.5
parent e6e0f914ba
commit 392fe7c569
19 changed files with 552 additions and 48 deletions
@@ -7,6 +7,7 @@ namespace LIT\MCP\Integrations\Divi\Library;
use LIT\MCP\Abilities\WriteFailed;
use LIT\MCP\Integrations\Divi\Release\Call;
use LIT\MCP\Integrations\Divi\Release\DiviAdapter;
use LIT\MCP\Integrations\Divi\Release\DiviFeature;
use LIT\MCP\Integrations\Divi\Release\DiviLocked;
use LIT\MCP\Integrations\Divi\Release\Manifest;
use LIT\MCP\Integrations\Divi\Release\Mirror;
@@ -55,7 +56,14 @@ class DiviLibraryStore implements DiviAdapter
{
return new Manifest(
Manifest::LIBRARY,
calls: [new Call(self::GLOBAL_LAYOUT . '::is_global_layout_template', 1)],
calls: [
// isGlobal() serves listing and describing as well as the global edits.
new Call(
self::GLOBAL_LAYOUT . '::is_global_layout_template',
1,
[DiviFeature::LibraryRead, DiviFeature::LibraryWrite]
),
],
postTypes: [self::POST_TYPE],
taxonomies: [...self::TAXONOMIES, 'layout_category', 'layout_tag'],
keys: [self::MODULE_TYPE, self::EXCLUDED_OPTIONS, self::BUILT_FOR, self::TEMPLATE_TYPE],
@@ -68,7 +76,8 @@ class DiviLibraryStore implements DiviAdapter
'Terme und Meta neuer Bibliothekseinträge (scope, layout_type, module_width, _et_pb_module_type, '
. '_et_pb_excluded_global_options, _et_pb_built_for_post_type, _et_pb_template_type)'
),
]
],
features: [DiviFeature::LibraryWrite]
);
}
+6 -1
View File
@@ -8,6 +8,7 @@ use Closure;
use LIT\MCP\Abilities\Errors;
use LIT\MCP\Integrations\Divi\Release\Call;
use LIT\MCP\Integrations\Divi\Release\DiviAdapter;
use LIT\MCP\Integrations\Divi\Release\DiviFeature;
use LIT\MCP\Integrations\Divi\Release\Manifest;
use WP_Error;
@@ -33,7 +34,11 @@ class DiviRoles implements DiviAdapter
public static function manifest(): Manifest
{
return new Manifest(Manifest::LIBRARY, calls: [new Call('et_pb_is_allowed', 1)]);
return new Manifest(
Manifest::LIBRARY,
calls: [new Call('et_pb_is_allowed', 1)],
features: [DiviFeature::Roles]
);
}
/** @param (Closure(string): bool)|null $check Test seam; null = Divi's et_pb_is_allowed(). */