fix: Expose task type on CoreTaskProcessingTask json

Signed-off-by: Marcel Klehr <mklehr@gmx.net>
This commit is contained in:
Marcel Klehr 2024-05-06 09:21:09 +02:00
parent 3593d9b631
commit 9a2cd6b914
2 changed files with 3 additions and 1 deletions

View file

@ -194,6 +194,7 @@ namespace OCA\Core;
*
* @psalm-type CoreTaskProcessingTask = array{
* id: ?int,
* type: string,
* status: 0|1|2|3|4|5,
* userId: ?string,
* appId: string,

View file

@ -193,12 +193,13 @@ final class Task implements \JsonSerializable {
}
/**
* @psalm-return array{id: ?int, status: self::STATUS_*, userId: ?string, appId: string, input: ?array<array-key, mixed>, output: ?array<array-key, mixed>, identifier: ?string, completionExpectedAt: ?int, progress: ?float}
* @psalm-return array{id: ?int, type: string, status: self::STATUS_*, userId: ?string, appId: string, input: ?array<array-key, mixed>, output: ?array<array-key, mixed>, identifier: ?string, completionExpectedAt: ?int, progress: ?float}
* @since 30.0.0
*/
public function jsonSerialize(): array {
return [
'id' => $this->getId(),
'type' => $this->getTaskTypeId(),
'status' => $this->getStatus(),
'userId' => $this->getUserId(),
'appId' => $this->getAppId(),