Initial
EK-DOS-WEB bauen und ausrollen / frontend (push) Failing after 22s
EK-DOS-WEB bauen und ausrollen / backend (push) Failing after 27s
EK-DOS-WEB bauen und ausrollen / deploy (push) Skipped

This commit is contained in:
Kyle Müller
2026-09-06 13:25:44 +02:00
commit 7d82e807fc
71 changed files with 10601 additions and 0 deletions
+45
View File
@@ -0,0 +1,45 @@
<?php
declare(strict_types=1);
namespace Ekdos\N8n;
use Ekdos\Support\Json;
/** Eine Antwort von n8n, roh und unbewertet. */
final readonly class Reply
{
public function __construct(
public int $status,
public string $body,
public string $contentType = '',
public bool $stale = false,
) {}
public function ok(): bool
{
return $this->status >= 200 && $this->status < 300;
}
/** Status fuer die Oberflaeche: ein Verbindungsfehler wird zu 502. */
public function statusOr(int $fallback = 502): int
{
return $this->status === 0 ? $fallback : $this->status;
}
public function decoded(): array
{
return Json::decode($this->body);
}
/** n8n liefert Listen mal als {"key":[...]}, mal als nacktes Array. */
public function items(string $key): array
{
return Json::listFrom($this->decoded(), $key);
}
public function asStale(): self
{
return new self($this->status, $this->body, $this->contentType, true);
}
}