diff options
Diffstat (limited to 'lib/public')
-rw-r--r-- | lib/public/Activity/IBulkConsumer.php | 24 | ||||
-rw-r--r-- | lib/public/Activity/IManager.php | 14 | ||||
-rw-r--r-- | lib/public/Search/IExternalProvider.php | 25 | ||||
-rw-r--r-- | lib/public/TaskProcessing/IManager.php | 10 | ||||
-rw-r--r-- | lib/public/TaskProcessing/Task.php | 20 |
5 files changed, 92 insertions, 1 deletions
diff --git a/lib/public/Activity/IBulkConsumer.php b/lib/public/Activity/IBulkConsumer.php new file mode 100644 index 00000000000..9fdf3516b9a --- /dev/null +++ b/lib/public/Activity/IBulkConsumer.php @@ -0,0 +1,24 @@ +<?php + +/** + * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later + */ + +namespace OCP\Activity; + +/** + * Interface IBulkConsumer + * + * @since 32.0.0 + */ +interface IBulkConsumer extends IConsumer { + /** + * @param IEvent $event + * @param array $affectedUserIds + * @param ISetting $setting + * @return void + * @since 32.0.0 + */ + public function bulkReceive(IEvent $event, array $affectedUserIds, ISetting $setting): void; +} diff --git a/lib/public/Activity/IManager.php b/lib/public/Activity/IManager.php index 30020b6eced..d638b8b2c6b 100644 --- a/lib/public/Activity/IManager.php +++ b/lib/public/Activity/IManager.php @@ -52,6 +52,20 @@ interface IManager { public function publish(IEvent $event): void; /** + * Bulk publish an event for multiple users + * taking into account the app specific activity settings + * + * Make sure to call at least the following methods before sending an Event: + * - setApp() + * - setType() + * + * @param IEvent $event + * @throws IncompleteActivityException if required values have not been set + * @since 32.0.0 + */ + public function bulkPublish(IEvent $event, array $affectedUserIds, ISetting $setting): void; + + /** * In order to improve lazy loading a closure can be registered which will be called in case * activity consumers are actually requested * diff --git a/lib/public/Search/IExternalProvider.php b/lib/public/Search/IExternalProvider.php new file mode 100644 index 00000000000..a9a8e3ad6ba --- /dev/null +++ b/lib/public/Search/IExternalProvider.php @@ -0,0 +1,25 @@ +<?php + +declare(strict_types=1); +/** + * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later + */ +namespace OCP\Search; + +/** + * Interface for search providers that forward user queries to external services. + * + * @since 32.0.0 + */ +interface IExternalProvider extends IProvider { + /** + * Indicates whether this search provider queries external (3rd-party) resources. + * This is used by the Unified Search modal filter (toggle switch). By default, searching through external providers is disabled. + * + * @return bool default false + * + * @since 32.0.0 + */ + public function isExternalProvider(): bool; +} diff --git a/lib/public/TaskProcessing/IManager.php b/lib/public/TaskProcessing/IManager.php index 723eca8f615..731250d7aa1 100644 --- a/lib/public/TaskProcessing/IManager.php +++ b/lib/public/TaskProcessing/IManager.php @@ -234,4 +234,14 @@ interface IManager { * @since 30.0.0 */ public function setTaskStatus(Task $task, int $status): void; + + /** + * Extract all input and output file IDs from a task + * + * @param Task $task + * @return list<int> + * @throws NotFoundException + * @since 32.0.0 + */ + public function extractFileIdsFromTask(Task $task): array; } diff --git a/lib/public/TaskProcessing/Task.php b/lib/public/TaskProcessing/Task.php index 71c271cd43d..06dc84d59ff 100644 --- a/lib/public/TaskProcessing/Task.php +++ b/lib/public/TaskProcessing/Task.php @@ -66,6 +66,7 @@ final class Task implements \JsonSerializable { protected ?int $scheduledAt = null; protected ?int $startedAt = null; protected ?int $endedAt = null; + protected bool $allowCleanup = true; /** * @param string $taskTypeId @@ -253,7 +254,23 @@ final class Task implements \JsonSerializable { } /** - * @psalm-return array{id: int, lastUpdated: int, type: string, status: 'STATUS_CANCELLED'|'STATUS_FAILED'|'STATUS_SUCCESSFUL'|'STATUS_RUNNING'|'STATUS_SCHEDULED'|'STATUS_UNKNOWN', userId: ?string, appId: string, input: array<string, list<numeric|string>|numeric|string>, output: ?array<string, list<numeric|string>|numeric|string>, customId: ?string, completionExpectedAt: ?int, progress: ?float, scheduledAt: ?int, startedAt: ?int, endedAt: ?int} + * @return bool + * @since 32.0.0 + */ + final public function getAllowCleanup(): bool { + return $this->allowCleanup; + } + + /** + * @param bool $allowCleanup + * @since 32.0.0 + */ + final public function setAllowCleanup(bool $allowCleanup): void { + $this->allowCleanup = $allowCleanup; + } + + /** + * @psalm-return array{id: int, lastUpdated: int, type: string, status: 'STATUS_CANCELLED'|'STATUS_FAILED'|'STATUS_SUCCESSFUL'|'STATUS_RUNNING'|'STATUS_SCHEDULED'|'STATUS_UNKNOWN', userId: ?string, appId: string, input: array<string, list<numeric|string>|numeric|string>, output: ?array<string, list<numeric|string>|numeric|string>, customId: ?string, completionExpectedAt: ?int, progress: ?float, scheduledAt: ?int, startedAt: ?int, endedAt: ?int, allowCleanup: bool} * @since 30.0.0 */ final public function jsonSerialize(): array { @@ -272,6 +289,7 @@ final class Task implements \JsonSerializable { 'scheduledAt' => $this->getScheduledAt(), 'startedAt' => $this->getStartedAt(), 'endedAt' => $this->getEndedAt(), + 'allowCleanup' => $this->getAllowCleanup(), ]; } |