diff options
-rw-r--r-- | core/ResponseDefinitions.php | 1 | ||||
-rw-r--r-- | core/openapi.json | 6 | ||||
-rw-r--r-- | lib/composer/composer/autoload_classmap.php | 1 | ||||
-rw-r--r-- | lib/composer/composer/autoload_static.php | 1 | ||||
-rw-r--r-- | lib/private/Search/SearchComposer.php | 2 | ||||
-rw-r--r-- | lib/public/Search/IInAppSearch.php | 34 |
6 files changed, 44 insertions, 1 deletions
diff --git a/core/ResponseDefinitions.php b/core/ResponseDefinitions.php index 7d54cf66061..b8f73bcdcda 100644 --- a/core/ResponseDefinitions.php +++ b/core/ResponseDefinitions.php @@ -104,6 +104,7 @@ namespace OCA\Core; * order: int, * triggers: string[], * filters: array<string, string>, + * inAppSearch: bool, * } * * @psalm-type CoreUnifiedSearchResultEntry = array{ diff --git a/core/openapi.json b/core/openapi.json index b703cfff79f..c5de93838a1 100644 --- a/core/openapi.json +++ b/core/openapi.json @@ -512,7 +512,8 @@ "icon", "order", "triggers", - "filters" + "filters", + "inAppSearch" ], "properties": { "id": { @@ -542,6 +543,9 @@ "additionalProperties": { "type": "string" } + }, + "inAppSearch": { + "type": "boolean" } } }, diff --git a/lib/composer/composer/autoload_classmap.php b/lib/composer/composer/autoload_classmap.php index 93feccfc473..85fbe3d9151 100644 --- a/lib/composer/composer/autoload_classmap.php +++ b/lib/composer/composer/autoload_classmap.php @@ -593,6 +593,7 @@ return array( 'OCP\\Search\\IFilter' => $baseDir . '/lib/public/Search/IFilter.php', 'OCP\\Search\\IFilterCollection' => $baseDir . '/lib/public/Search/IFilterCollection.php', 'OCP\\Search\\IFilteringProvider' => $baseDir . '/lib/public/Search/IFilteringProvider.php', + 'OCP\\Search\\IInAppSearch' => $baseDir . '/lib/public/Search/IInAppSearch.php', 'OCP\\Search\\IProvider' => $baseDir . '/lib/public/Search/IProvider.php', 'OCP\\Search\\ISearchQuery' => $baseDir . '/lib/public/Search/ISearchQuery.php', 'OCP\\Search\\PagedProvider' => $baseDir . '/lib/public/Search/PagedProvider.php', diff --git a/lib/composer/composer/autoload_static.php b/lib/composer/composer/autoload_static.php index 8a81ca82827..1881fd88eb3 100644 --- a/lib/composer/composer/autoload_static.php +++ b/lib/composer/composer/autoload_static.php @@ -626,6 +626,7 @@ class ComposerStaticInit749170dad3f5e7f9ca158f5a9f04f6a2 'OCP\\Search\\IFilter' => __DIR__ . '/../../..' . '/lib/public/Search/IFilter.php', 'OCP\\Search\\IFilterCollection' => __DIR__ . '/../../..' . '/lib/public/Search/IFilterCollection.php', 'OCP\\Search\\IFilteringProvider' => __DIR__ . '/../../..' . '/lib/public/Search/IFilteringProvider.php', + 'OCP\\Search\\IInAppSearch' => __DIR__ . '/../../..' . '/lib/public/Search/IInAppSearch.php', 'OCP\\Search\\IProvider' => __DIR__ . '/../../..' . '/lib/public/Search/IProvider.php', 'OCP\\Search\\ISearchQuery' => __DIR__ . '/../../..' . '/lib/public/Search/ISearchQuery.php', 'OCP\\Search\\PagedProvider' => __DIR__ . '/../../..' . '/lib/public/Search/PagedProvider.php', diff --git a/lib/private/Search/SearchComposer.php b/lib/private/Search/SearchComposer.php index 41d969ca90b..0c465385a8c 100644 --- a/lib/private/Search/SearchComposer.php +++ b/lib/private/Search/SearchComposer.php @@ -31,6 +31,7 @@ use InvalidArgumentException; use OCP\IURLGenerator; use OCP\Search\FilterDefinition; use OCP\Search\IFilteringProvider; +use OCP\Search\IInAppSearch; use OC\AppFramework\Bootstrap\Coordinator; use OCP\IUser; use OCP\Search\IFilter; @@ -199,6 +200,7 @@ class SearchComposer { 'order' => $provider->getOrder($route, $routeParameters), 'triggers' => $triggers, 'filters' => $this->getFiltersType($filters, $provider->getId()), + 'inAppSearch' => $provider instanceof IInAppSearch, ]; }, $this->providers, diff --git a/lib/public/Search/IInAppSearch.php b/lib/public/Search/IInAppSearch.php new file mode 100644 index 00000000000..9e1e294bf4d --- /dev/null +++ b/lib/public/Search/IInAppSearch.php @@ -0,0 +1,34 @@ +<?php + +declare(strict_types=1); + +/** + * @copyright 2023 Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com> + * + * @author Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com> + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ +namespace OCP\Search; + +/** + * Interface for search providers supporting in-app search + * + * @since 28.0.0 + */ +interface IInAppSearch extends IProvider { +} |