This commit is contained in:
2025-12-08 00:47:00 +01:00
parent 9ceeecaf4e
commit 7522e79242
3 changed files with 71 additions and 12 deletions

View File

@@ -856,6 +856,9 @@ class ApiKernel
case 'account.bridge.test':
$this->handleAccountBridgeTest();
break;
case 'placeholders.status':
$this->handlePlaceholderStatus();
break;
case 'placeholders.schema':
$this->handlePlaceholderSchema();
break;
@@ -1257,6 +1260,20 @@ class ApiKernel
]);
}
private function handlePlaceholderStatus(): void
{
$user = $this->authService->requireAuth();
$customerId = (int)($user['customer_id'] ?? 0);
$bridge = $this->resolveBridgeConfig($customerId);
$url = trim((string)($bridge['url'] ?? ''));
$token = trim((string)($bridge['token'] ?? ''));
$available = ($url !== '' && $token !== '');
$this->respond([
'ok' => true,
'available' => $available,
]);
}
private function fetchPlaceholderSchema(string $url, string $token, int $ttl): array
{
$cacheFile = $this->placeholderCachePath($url, $token);