diff --git a/src/AutoUpdater.php b/src/AutoUpdater.php index e714a0f1..79500455 100644 --- a/src/AutoUpdater.php +++ b/src/AutoUpdater.php @@ -17,4 +17,9 @@ public function quitAndInstall(): void { $this->client->post('auto-updater/quit-and-install'); } + + public function downloadUpdate(): void + { + $this->client->post('auto-updater/download-update'); + } } diff --git a/src/Events/AutoUpdater/DownloadProgress.php b/src/Events/AutoUpdater/DownloadProgress.php index 42045b27..23393157 100644 --- a/src/Events/AutoUpdater/DownloadProgress.php +++ b/src/Events/AutoUpdater/DownloadProgress.php @@ -12,7 +12,13 @@ class DownloadProgress implements ShouldBroadcastNow { use Dispatchable, InteractsWithSockets, SerializesModels; - public function __construct(public int $total, public int $delta, public int $transferred, public float $percent, public int $bytesPerSecond) {} + public function __construct( + public int $total, + public int $delta, + public int $transferred, + public float $percent, + public int $bytesPerSecond + ) {} public function broadcastOn() { diff --git a/src/Events/AutoUpdater/Error.php b/src/Events/AutoUpdater/Error.php index 8444dcd1..9d2219d3 100644 --- a/src/Events/AutoUpdater/Error.php +++ b/src/Events/AutoUpdater/Error.php @@ -12,7 +12,11 @@ class Error implements ShouldBroadcastNow { use Dispatchable, InteractsWithSockets, SerializesModels; - public function __construct(public string $error) {} + public function __construct( + public string $name, + public string $message, + public ?string $stack, + ) {} public function broadcastOn() { diff --git a/src/Events/AutoUpdater/UpdateAvailable.php b/src/Events/AutoUpdater/UpdateAvailable.php index 5dc55cdc..1fb05fb7 100644 --- a/src/Events/AutoUpdater/UpdateAvailable.php +++ b/src/Events/AutoUpdater/UpdateAvailable.php @@ -12,7 +12,15 @@ class UpdateAvailable implements ShouldBroadcastNow { use Dispatchable, InteractsWithSockets, SerializesModels; - public function __construct() {} + public function __construct( + public string $version, + public array $files, + public string $releaseDate, + public ?string $releaseName, + public string|array|null $releaseNotes, + public ?int $stagingPercentage, + public ?string $minimumSystemVersion, + ) {} public function broadcastOn() { diff --git a/src/Events/AutoUpdater/UpdateCancelled.php b/src/Events/AutoUpdater/UpdateCancelled.php new file mode 100644 index 00000000..09d01b69 --- /dev/null +++ b/src/Events/AutoUpdater/UpdateCancelled.php @@ -0,0 +1,31 @@ +