From 0e90eb57e65c45de55d11a61aca04318a2638291 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Fri, 13 Dec 2024 06:16:27 +0000 Subject: [PATCH 01/20] Adding search files functionality in Paperless from Nextcloud Signed-off-by: Goh Jin Di --- lib/AppInfo/Application.php | 2 + lib/Controller/SearchController.php | 36 + lib/Search/SearchProvider.php | 112 +++ lib/Service/ApiService.php | 22 + lib/Service/NetworkService.php | 96 ++ package-lock.json | 1294 +++++++++++++++++++++++---- package.json | 12 +- 7 files changed, 1405 insertions(+), 169 deletions(-) create mode 100644 lib/Controller/SearchController.php create mode 100644 lib/Search/SearchProvider.php create mode 100644 lib/Service/NetworkService.php diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index f806066..ca1e28b 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -5,6 +5,7 @@ namespace OCA\Paperless\AppInfo; use OCA\Paperless\Listener\FileActionListener; +use OCA\Paperless\Search\SearchProvider; use OCP\AppFramework\App; use OCP\AppFramework\Bootstrap\IBootContext; use OCP\AppFramework\Bootstrap\IBootstrap; @@ -21,6 +22,7 @@ public function __construct() { public function register(IRegistrationContext $context): void { $context->registerEventListener(LoadAdditionalScriptsEvent::class, FileActionListener::class); + $context->registerSearchProvider(SearchProvider::class); } public function boot(IBootContext $context): void { diff --git a/lib/Controller/SearchController.php b/lib/Controller/SearchController.php new file mode 100644 index 0000000..12d3472 --- /dev/null +++ b/lib/Controller/SearchController.php @@ -0,0 +1,36 @@ +apiService->search($this->userId, $query, $limit, $offset); + + if (isset($results['error'])) { + return new DataResponse(['error' => $results['error']], Http::STATUS_BAD_REQUEST); + } + + return new DataResponse($results); + } +} diff --git a/lib/Search/SearchProvider.php b/lib/Search/SearchProvider.php new file mode 100644 index 0000000..6679e6b --- /dev/null +++ b/lib/Search/SearchProvider.php @@ -0,0 +1,112 @@ +l10n->t('Paperless Search Result'); + } + + public function getOrder(string $route, array $routeParameters): int { + return 20; // Adjust priority as needed + } + + public function search(IUser $user, ISearchQuery $query): SearchResult { + if (!$this->appManager->isEnabledForUser(Application::APP_ID, $user)) { + return SearchResult::complete($this->getName(), []); + } + + $limit = $query->getLimit(); + $term = $query->getTerm(); + $offset = $query->getCursor(); + $offset = $offset ? intval($offset) : 0; + + $url = $this->config->getUserValue($user->getUID(), Application::APP_ID, 'url'); + $apiKey = $this->configService->getConfig($user->getUID(), 'token'); + + if ($url === '' || $apiKey === '' ) { + return SearchResult::paginated($this->getName(), [], 0); + } + + // Call Paperless API + $searchResult = $this->apiService->searchMessages($user->getUID(), $term, $offset, $limit); + if (isset($searchResult['error'])) { + return SearchResult::paginated($this->getName(), [], 0); + } + + $dataEntries = $searchResult['results'] ?? []; + $formattedResults = array_map(function (array $entry) use ($url): SearchResultEntry { + $finalThumbnailUrl = $this->getThumbnailUrl($entry); + $title = $entry['title'] ?? 'Untitled'; + $context = $entry['__search_hit__']['highlights'] ?? ''; + $link = $this->getLinkToPaperless($entry, $url); + return new SearchResultEntry( + $finalThumbnailUrl, + $title, + strip_tags($context), + $link, + $finalThumbnailUrl === '' ? 'icon-paperless-search-fallback' : '', + true + ); + }, $dataEntries); + + return SearchResult::paginated( + $this->getName(), + $formattedResults, + $offset + count($dataEntries) + ); + } + + /** + * @param array $entry + * @param string $url + * @return string + */ + protected function getLinkToPaperless(array $entry, string $url): string { + return rtrim($url, '/') . "/documents/" . ($entry['id'] ?? '#'); + } + + /** + * @param array $entry + * @return string + */ + protected function getThumbnailUrl(array $entry): string { + return ''; + } +} diff --git a/lib/Service/ApiService.php b/lib/Service/ApiService.php index c9f9fc4..c0168e0 100644 --- a/lib/Service/ApiService.php +++ b/lib/Service/ApiService.php @@ -21,6 +21,7 @@ class ApiService { public function __construct( private string $userId, private IRootFolder $root, + private NetworkService $networkService, ConfigService $configService, IClientService $clientService, ) { @@ -67,4 +68,25 @@ public function sendFile(int $fileId): void { ], ); } + + public function searchMessages(string $userId, string $term, int $offset = 0, int $limit = 10): array { + // Search API use Advanced Search, so asterik is needed behind and after query + $result = $this->request($userId, 'documents', [ + 'format' => 'json', + 'query' => '*' . $term . '*' , + ]); + + if (isset($result['error'])) { + return (array) $result; + } + + // Sort by most recent + // $messages = array_reverse($result['document'] ?? []); + return array_slice($result, $offset, $limit); + } + + public function request(string $userId, string $endPoint, array $params = [], string $method = 'GET', + bool $jsonResponse = true, bool $paperlessApiRequest = true) { + return $this->networkService->request($userId, $endPoint, $params, $method, $jsonResponse, $paperlessApiRequest); + } } diff --git a/lib/Service/NetworkService.php b/lib/Service/NetworkService.php new file mode 100644 index 0000000..3faef15 --- /dev/null +++ b/lib/Service/NetworkService.php @@ -0,0 +1,96 @@ +client = new Client(); + } + + + public function request(string $userId, string $endPoint, array $params = [], string $method = 'GET', + bool $jsonResponse = true, bool $paperlessApiRequest = true) { + $paperlessUrl = $this->config->getUserValue($userId, Application::APP_ID, 'url'); + $apiKey = $this->config->getUserValue($userId, Application::APP_ID, 'token'); + + try { + $url = rtrim($paperlessUrl, '/') . '/api/' . $endPoint; + + $options = [ + 'headers' => [ + 'Authorization' => 'Token ' . $apiKey, + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + ], + ]; + + if (count($params) > 0) { + if ($method === 'GET') { + $url .= '/?' . http_build_query($params); + } else { + $options['json'] = $params; + } + } + + + if ($method === 'GET') { + $response = $this->client->get($url, $options); + } elseif ($method === 'POST') { + $response = $this->client->post($url, $options); + } elseif ($method === 'PUT') { + $response = $this->client->put($url, $options); + } elseif ($method === 'DELETE') { + $response = $this->client->delete($url, $options); + } else { + return ['error' => $this->l10n->t('Bad HTTP method')]; + } + + $body = $response->getBody()->getContents(); + $respCode = $response->getStatusCode(); + + if ($respCode >= 400) { + return ['error' => $this->l10n->t('Bad credentials')]; + } + + if ($jsonResponse) { + return json_decode($body, true); + } + return $body; + } catch (ServerException | ClientException $e) { + $body = $e->getResponse()->getBody(); + $this->logger->warning('Paperless API error : ' . $body, ['app' => Application::APP_ID]); + return ['error' => $e->getMessage()]; + } catch (Exception | Throwable $e) { + $this->logger->warning('Paperless API error', ['exception' => $e, 'app' => Application::APP_ID]); + return ['error' => $e->getMessage()]; + } + } +} diff --git a/package-lock.json b/package-lock.json index bb15db6..6e748de 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,14 +9,16 @@ "version": "1.0.0", "license": "AGPL-3.0-or-later", "dependencies": { - "@nextcloud/axios": "^2.4.0", - "@nextcloud/dialogs": "^4.2.5", + "@nextcloud/axios": "^2.5.1", + "@nextcloud/dialogs": "^4.2.7", "@nextcloud/files": "^3.1.0", - "@nextcloud/initial-state": "^2.1.0", + "@nextcloud/initial-state": "^2.2.0", "@nextcloud/l10n": "^2.2.0", - "@nextcloud/router": "^3.0.0", + "@nextcloud/router": "^3.0.1", "@nextcloud/vue": "^8.6.1", - "vue": "^2.7.16" + "@nextcloud/vue-richtext": "^2.1.0-beta.6", + "vue": "^2.7.16", + "vue-material-design-icons": "^5.3.1" }, "devDependencies": { "@nextcloud/browserslist-config": "^3.0.0", @@ -3079,200 +3081,1163 @@ "dependencies": { "@nextcloud/auth": "^2.3.0" }, - "engines": { - "node": "^20.0.0", - "npm": "^10.0.0" + "engines": { + "node": "^20.0.0", + "npm": "^10.0.0" + } + }, + "node_modules/@nextcloud/initial-state": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@nextcloud/initial-state/-/initial-state-2.2.0.tgz", + "integrity": "sha512-cDW98L5KGGgpS8pzd+05304/p80cyu8U2xSDQGa+kGPTpUFmCbv2qnO5WrwwGTauyjYijCal2bmw82VddSH+Pg==", + "license": "GPL-3.0-or-later", + "engines": { + "node": "^20.0.0", + "npm": "^10.0.0" + } + }, + "node_modules/@nextcloud/l10n": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@nextcloud/l10n/-/l10n-2.2.0.tgz", + "integrity": "sha512-UAM2NJcl/NR46MANSF7Gr7q8/Up672zRyGrxLpN3k4URNmWQM9upkbRME+1K3T29wPrUyOIbQu710ZjvZafqFA==", + "license": "GPL-3.0-or-later", + "dependencies": { + "@nextcloud/router": "^2.1.2", + "@nextcloud/typings": "^1.7.0", + "dompurify": "^3.0.3", + "escape-html": "^1.0.3", + "node-gettext": "^3.0.0" + }, + "engines": { + "node": "^20.0.0", + "npm": "^9.0.0" + } + }, + "node_modules/@nextcloud/l10n/node_modules/@nextcloud/router": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@nextcloud/router/-/router-2.2.1.tgz", + "integrity": "sha512-ZRc/WI0RaksEJMz08H/6LimIdP+1A1xTHThCYEghs7VgAKNp5917vT2OKSpG0cMRbIwk0ongFVt5FB5qjy/iFg==", + "dependencies": { + "@nextcloud/typings": "^1.7.0", + "core-js": "^3.6.4" + }, + "engines": { + "node": "^20.0.0", + "npm": "^10.0.0" + } + }, + "node_modules/@nextcloud/logger": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/@nextcloud/logger/-/logger-2.7.0.tgz", + "integrity": "sha512-DSJg9H1jT2zfr7uoP4tL5hKncyY+LOuxJzLauj0M/f6gnpoXU5WG1Zw8EFPOrRWjkC0ZE+NCqrMnITgdRRpXJQ==", + "dependencies": { + "@nextcloud/auth": "^2.0.0", + "core-js": "^3.6.4" + }, + "engines": { + "node": "^20.0.0", + "npm": "^9.0.0" + } + }, + "node_modules/@nextcloud/paths": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@nextcloud/paths/-/paths-2.2.1.tgz", + "integrity": "sha512-M3ShLjrxR7B48eKThLMoqbxTqTKyQXcwf9TgeXQGbCIhiHoXU6as5j8l5qNv/uZlANokVdowpuWHBi3b2+YNNA==", + "license": "GPL-3.0-or-later", + "engines": { + "node": "^20.0.0", + "npm": "^10.0.0" + } + }, + "node_modules/@nextcloud/router": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@nextcloud/router/-/router-3.0.1.tgz", + "integrity": "sha512-Ci/uD3x8OKHdxSqXL6gRJ+mGJOEXjeiHjj7hqsZqVTsT7kOrCjDf0/J8z5RyLlokKZ0IpSe+hGxgi3YB7Gpw3Q==", + "license": "GPL-3.0-or-later", + "dependencies": { + "@nextcloud/typings": "^1.7.0" + }, + "engines": { + "node": "^20.0.0", + "npm": "^10.0.0" + } + }, + "node_modules/@nextcloud/sharing": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@nextcloud/sharing/-/sharing-0.2.3.tgz", + "integrity": "sha512-hxQFOBBahbJkcmAGZFVS3943pQGSafNF6LMHmgcj0JPqExu1DWKuZvsCXZnGkaRJVcewHnZFcLAhpOf+VfcZmA==", + "license": "GPL-3.0-or-later", + "dependencies": { + "@nextcloud/initial-state": "^2.2.0" + }, + "engines": { + "node": "^20.0.0", + "npm": "^10.0.0" + } + }, + "node_modules/@nextcloud/stylelint-config": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@nextcloud/stylelint-config/-/stylelint-config-2.4.0.tgz", + "integrity": "sha512-S/q/offcs9pwnkjSrnfvsONryCOe6e1lfK2sszN6ZtkYyXvaqi8EbQuuhaGlxCstn9oXwbXfAI6O3Y8lGrjdFg==", + "dev": true, + "engines": { + "node": "^20.0.0", + "npm": "^10.0.0" + }, + "peerDependencies": { + "stylelint": "^15.6.0", + "stylelint-config-recommended-scss": "^13.1.0", + "stylelint-config-recommended-vue": "^1.1.0" + } + }, + "node_modules/@nextcloud/timezones": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@nextcloud/timezones/-/timezones-0.1.1.tgz", + "integrity": "sha512-ldLuLyz605sszetnp6jy6mtlThu4ICKsZThxHIZwn6t4QzjQH3xr+k8mRU7GIvKq9egUFDqBp4gBjxm3/ROZig==", + "license": "AGPL-3.0-or-later", + "dependencies": { + "ical.js": "^2.0.1" + }, + "engines": { + "node": "^20.0.0", + "npm": "^10.0.0" + } + }, + "node_modules/@nextcloud/timezones/node_modules/ical.js": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/ical.js/-/ical.js-2.1.0.tgz", + "integrity": "sha512-BOVfrH55xQ6kpS3muGvIXIg2l7p+eoe12/oS7R5yrO3TL/j/bLsR0PR+tYQESFbyTbvGgPHn9zQ6tI4FWyuSaQ==", + "license": "MPL-2.0" + }, + "node_modules/@nextcloud/typings": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@nextcloud/typings/-/typings-1.9.1.tgz", + "integrity": "sha512-i0l/L5gKW8EACbXHVxXM6wn3sUhY2qmnL2OijppzU4dENC7/hqySMQDer7/+cJbNSNG7uHF/Z+9JmHtDfRfuGg==", + "license": "GPL-3.0-or-later", + "dependencies": { + "@types/jquery": "3.5.16" + }, + "engines": { + "node": "^20.0.0", + "npm": "^10.0.0" + } + }, + "node_modules/@nextcloud/vue": { + "version": "8.21.0", + "resolved": "https://registry.npmjs.org/@nextcloud/vue/-/vue-8.21.0.tgz", + "integrity": "sha512-at06uh2JJkn8dV3Yzyoag2z1g6omad8MZ8yKWE+9ZAGP+kaysbnI5q3lB7KXu8SVRtX3Rex8/oal0jgsbb6Spg==", + "license": "AGPL-3.0-or-later", + "dependencies": { + "@floating-ui/dom": "^1.1.0", + "@linusborg/vue-simple-portal": "^0.1.5", + "@nextcloud/auth": "^2.4.0", + "@nextcloud/axios": "^2.5.0", + "@nextcloud/browser-storage": "^0.4.0", + "@nextcloud/capabilities": "^1.2.0", + "@nextcloud/event-bus": "^3.3.1", + "@nextcloud/initial-state": "^2.2.0", + "@nextcloud/l10n": "^3.1.0", + "@nextcloud/logger": "^3.0.2", + "@nextcloud/router": "^3.0.1", + "@nextcloud/sharing": "^0.2.3", + "@nextcloud/timezones": "^0.1.1", + "@nextcloud/vue-select": "^3.25.1", + "@vueuse/components": "^11.0.0", + "@vueuse/core": "^11.0.0", + "clone": "^2.1.2", + "debounce": "^2.2.0", + "dompurify": "^3.0.5", + "emoji-mart-vue-fast": "^15.0.1", + "escape-html": "^1.0.3", + "floating-vue": "^1.0.0-beta.19", + "focus-trap": "^7.4.3", + "linkify-string": "^4.0.0", + "md5": "^2.3.0", + "rehype-external-links": "^3.0.0", + "rehype-highlight": "^7.0.1", + "rehype-react": "^7.1.2", + "remark-breaks": "^4.0.0", + "remark-gfm": "^4.0.0", + "remark-parse": "^11.0.0", + "remark-rehype": "^11.0.0", + "splitpanes": "^2.4.1", + "string-length": "^5.0.1", + "striptags": "^3.2.0", + "tributejs": "^5.1.3", + "unified": "^11.0.1", + "unist-builder": "^4.0.0", + "unist-util-visit": "^5.0.0", + "vue": "^2.7.16", + "vue-color": "^2.8.1", + "vue-frag": "^1.4.3", + "vue-router": "^3.6.5", + "vue2-datepicker": "^3.11.0" + }, + "engines": { + "node": "^20.0.0", + "npm": "^10.0.0" + } + }, + "node_modules/@nextcloud/vue-richtext": { + "version": "2.1.0-beta.6", + "resolved": "https://registry.npmjs.org/@nextcloud/vue-richtext/-/vue-richtext-2.1.0-beta.6.tgz", + "integrity": "sha512-LIhBCpFEfimUCHlPuhRADwTDXwOf4SASaQLYowofwvFfqTBjYi/TZdQfP4UBPaVFP2aKssOxuZ3HT83Z77ROAw==", + "license": "AGPL-3.0", + "dependencies": { + "@nextcloud/axios": "^2.0.0", + "@nextcloud/event-bus": "^3.0.2", + "@nextcloud/initial-state": "^2.0.0", + "@nextcloud/router": "^2.0.0", + "@nextcloud/vue": "^7.5.0", + "clone": "^2.1.2", + "vue": "^2.7.8", + "vue-material-design-icons": "^5.1.2" + }, + "engines": { + "node": ">=14.0.0", + "npm": ">=7.0.0" + }, + "peerDependencies": { + "vue": "^2.7.8" + } + }, + "node_modules/@nextcloud/vue-richtext/node_modules/@nextcloud/browser-storage": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@nextcloud/browser-storage/-/browser-storage-0.2.0.tgz", + "integrity": "sha512-qRetNoCMHzfJyuQ7uvlwUXNwXlm5eSy4h8hI0Oa9HKbej57WGBYxRqsHElFzipSPh7mBUdFnz5clGpzIQx8+HQ==", + "license": "GPL-3.0-or-later", + "dependencies": { + "core-js": "3.25.5" + }, + "engines": { + "node": "^16.0.0", + "npm": "^7.0.0 || ^8.0.0" + } + }, + "node_modules/@nextcloud/vue-richtext/node_modules/@nextcloud/router": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@nextcloud/router/-/router-2.2.1.tgz", + "integrity": "sha512-ZRc/WI0RaksEJMz08H/6LimIdP+1A1xTHThCYEghs7VgAKNp5917vT2OKSpG0cMRbIwk0ongFVt5FB5qjy/iFg==", + "license": "GPL-3.0-or-later", + "dependencies": { + "@nextcloud/typings": "^1.7.0", + "core-js": "^3.6.4" + }, + "engines": { + "node": "^20.0.0", + "npm": "^10.0.0" + } + }, + "node_modules/@nextcloud/vue-richtext/node_modules/@nextcloud/vue": { + "version": "7.12.8", + "resolved": "https://registry.npmjs.org/@nextcloud/vue/-/vue-7.12.8.tgz", + "integrity": "sha512-qNLQJE8XH4PpmYDTuBkXLiJ0ZZ34Rh25iWEWIcFG8wE3gKj3hKxQXbkJFoZWE8eBFi4TJsmvd/PGixII2S35DQ==", + "license": "AGPL-3.0-or-later", + "dependencies": { + "@floating-ui/dom": "^1.1.0", + "@nextcloud/auth": "^2.0.0", + "@nextcloud/axios": "^2.0.0", + "@nextcloud/browser-storage": "^0.2.0", + "@nextcloud/calendar-js": "^6.0.0", + "@nextcloud/capabilities": "^1.0.4", + "@nextcloud/dialogs": "^4.0.0", + "@nextcloud/event-bus": "^3.0.0", + "@nextcloud/initial-state": "^2.0.0", + "@nextcloud/l10n": "^2.0.1", + "@nextcloud/logger": "^2.2.1", + "@nextcloud/router": "^2.0.0", + "@nextcloud/vue-select": "^3.21.2", + "@skjnldsv/sanitize-svg": "^1.0.2", + "@vueuse/components": "^10.0.2", + "clone": "^2.1.2", + "debounce": "1.2.1", + "emoji-mart-vue-fast": "^12.0.1", + "escape-html": "^1.0.3", + "floating-vue": "^1.0.0-beta.19", + "focus-trap": "^7.4.3", + "hammerjs": "^2.0.8", + "linkify-string": "^4.0.0", + "md5": "^2.3.0", + "node-polyfill-webpack-plugin": "^2.0.1", + "rehype-external-links": "^3.0.0", + "rehype-react": "^7.1.2", + "remark-breaks": "^3.0.2", + "remark-parse": "^10.0.1", + "remark-rehype": "^10.1.0", + "splitpanes": "^2.4.1", + "string-length": "^5.0.1", + "striptags": "^3.2.0", + "tributejs": "^5.1.3", + "unified": "^10.1.2", + "unist-builder": "^3.0.1", + "unist-util-visit": "^4.1.2", + "vue": "^2.7.14", + "vue-color": "^2.8.1", + "vue-frag": "^1.4.3", + "vue-material-design-icons": "^5.1.2", + "vue-multiselect": "^2.1.6", + "vue2-datepicker": "^3.11.0" + }, + "engines": { + "node": "^16.0.0", + "npm": "^7.0.0 || ^8.0.0" + } + }, + "node_modules/@nextcloud/vue-richtext/node_modules/@types/hast": { + "version": "2.3.10", + "resolved": "https://registry.npmjs.org/@types/hast/-/hast-2.3.10.tgz", + "integrity": "sha512-McWspRw8xx8J9HurkVBfYj0xKoE25tOFlHGdx4MJ5xORQrMGZNqJhVQWaIbm6Oyla5kYOXtDiopzKRJzEOkwJw==", + "license": "MIT", + "dependencies": { + "@types/unist": "^2" + } + }, + "node_modules/@nextcloud/vue-richtext/node_modules/@types/mdast": { + "version": "3.0.15", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.15.tgz", + "integrity": "sha512-LnwD+mUEfxWMa1QpDraczIn6k0Ee3SMicuYSSzS6ZYl2gKS09EClnJYGd8Du6rfc5r/GZEk5o1mRb8TaTj03sQ==", + "license": "MIT", + "dependencies": { + "@types/unist": "^2" + } + }, + "node_modules/@nextcloud/vue-richtext/node_modules/@types/unist": { + "version": "2.0.11", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.11.tgz", + "integrity": "sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA==", + "license": "MIT" + }, + "node_modules/@nextcloud/vue-richtext/node_modules/core-js": { + "version": "3.25.5", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.25.5.tgz", + "integrity": "sha512-nbm6eZSjm+ZuBQxCUPQKQCoUEfFOXjUZ8dTTyikyKaWrTYmAVbykQfwsKE5dBK88u3QCkCrzsx/PPlKfhsvgpw==", + "hasInstallScript": true, + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/core-js" + } + }, + "node_modules/@nextcloud/vue-richtext/node_modules/debounce": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/debounce/-/debounce-1.2.1.tgz", + "integrity": "sha512-XRRe6Glud4rd/ZGQfiV1ruXSfbvfJedlV9Y6zOlP+2K04vBYiJEte6stfFkCP03aMnY5tsipamumUjL14fofug==", + "license": "MIT" + }, + "node_modules/@nextcloud/vue-richtext/node_modules/emoji-mart-vue-fast": { + "version": "12.0.5", + "resolved": "https://registry.npmjs.org/emoji-mart-vue-fast/-/emoji-mart-vue-fast-12.0.5.tgz", + "integrity": "sha512-XFNwIk+ConSAjC4tmk//s6btlo3oQco7TBgP914Qytg/15jLa/0VrWNg271W2MTv+8N8BxYl2dDn3cZJxcreqw==", + "license": "BSD-3-Clause", + "dependencies": { + "@babel/runtime": "^7.18.6", + "core-js": "^3.23.5" + }, + "peerDependencies": { + "vue": ">2.0.0" + } + }, + "node_modules/@nextcloud/vue-richtext/node_modules/escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@nextcloud/vue-richtext/node_modules/is-buffer": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz", + "integrity": "sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/@nextcloud/vue-richtext/node_modules/is-plain-obj": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz", + "integrity": "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@nextcloud/vue-richtext/node_modules/mdast-util-find-and-replace": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/mdast-util-find-and-replace/-/mdast-util-find-and-replace-2.2.2.tgz", + "integrity": "sha512-MTtdFRz/eMDHXzeK6W3dO7mXUlF82Gom4y0oOgvHhh/HXZAGvIQDUvQ0SuUx+j2tv44b8xTHOm8K/9OoRFnXKw==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^3.0.0", + "escape-string-regexp": "^5.0.0", + "unist-util-is": "^5.0.0", + "unist-util-visit-parents": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/@nextcloud/vue-richtext/node_modules/mdast-util-from-markdown": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-1.3.1.tgz", + "integrity": "sha512-4xTO/M8c82qBcnQc1tgpNtubGUW/Y1tBQ1B0i5CtSoelOLKFYlElIr3bvgREYYO5iRqbMY1YuqZng0GVOI8Qww==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^3.0.0", + "@types/unist": "^2.0.0", + "decode-named-character-reference": "^1.0.0", + "mdast-util-to-string": "^3.1.0", + "micromark": "^3.0.0", + "micromark-util-decode-numeric-character-reference": "^1.0.0", + "micromark-util-decode-string": "^1.0.0", + "micromark-util-normalize-identifier": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.0", + "unist-util-stringify-position": "^3.0.0", + "uvu": "^0.5.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/@nextcloud/vue-richtext/node_modules/mdast-util-newline-to-break": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-newline-to-break/-/mdast-util-newline-to-break-1.0.0.tgz", + "integrity": "sha512-491LcYv3gbGhhCrLoeALncQmega2xPh+m3gbsIhVsOX4sw85+ShLFPvPyibxc1Swx/6GtzxgVodq+cGa/47ULg==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^3.0.0", + "mdast-util-find-and-replace": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/@nextcloud/vue-richtext/node_modules/mdast-util-to-hast": { + "version": "12.3.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-12.3.0.tgz", + "integrity": "sha512-pits93r8PhnIoU4Vy9bjW39M2jJ6/tdHyja9rrot9uujkN7UTU9SDnE6WNJz/IGyQk3XHX6yNNtrBH6cQzm8Hw==", + "license": "MIT", + "dependencies": { + "@types/hast": "^2.0.0", + "@types/mdast": "^3.0.0", + "mdast-util-definitions": "^5.0.0", + "micromark-util-sanitize-uri": "^1.1.0", + "trim-lines": "^3.0.0", + "unist-util-generated": "^2.0.0", + "unist-util-position": "^4.0.0", + "unist-util-visit": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/@nextcloud/vue-richtext/node_modules/mdast-util-to-string": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-3.2.0.tgz", + "integrity": "sha512-V4Zn/ncyN1QNSqSBxTrMOLpjr+IKdHl2v3KVLoWmDPscP4r9GcCi71gjgvUV1SFSKh92AjAG4peFuBl2/YgCJg==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/@nextcloud/vue-richtext/node_modules/micromark": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/micromark/-/micromark-3.2.0.tgz", + "integrity": "sha512-uD66tJj54JLYq0De10AhWycZWGQNUvDI55xPgk2sQM5kn1JYlhbCMTtEeT27+vAhW2FBQxLlOmS3pmA7/2z4aA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "@types/debug": "^4.0.0", + "debug": "^4.0.0", + "decode-named-character-reference": "^1.0.0", + "micromark-core-commonmark": "^1.0.1", + "micromark-factory-space": "^1.0.0", + "micromark-util-character": "^1.0.0", + "micromark-util-chunked": "^1.0.0", + "micromark-util-combine-extensions": "^1.0.0", + "micromark-util-decode-numeric-character-reference": "^1.0.0", + "micromark-util-encode": "^1.0.0", + "micromark-util-normalize-identifier": "^1.0.0", + "micromark-util-resolve-all": "^1.0.0", + "micromark-util-sanitize-uri": "^1.0.0", + "micromark-util-subtokenize": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.1", + "uvu": "^0.5.0" + } + }, + "node_modules/@nextcloud/vue-richtext/node_modules/micromark-core-commonmark": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-1.1.0.tgz", + "integrity": "sha512-BgHO1aRbolh2hcrzL2d1La37V0Aoz73ymF8rAcKnohLy93titmv62E0gP8Hrx9PKcKrqCZ1BbLGbP3bEhoXYlw==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "decode-named-character-reference": "^1.0.0", + "micromark-factory-destination": "^1.0.0", + "micromark-factory-label": "^1.0.0", + "micromark-factory-space": "^1.0.0", + "micromark-factory-title": "^1.0.0", + "micromark-factory-whitespace": "^1.0.0", + "micromark-util-character": "^1.0.0", + "micromark-util-chunked": "^1.0.0", + "micromark-util-classify-character": "^1.0.0", + "micromark-util-html-tag-name": "^1.0.0", + "micromark-util-normalize-identifier": "^1.0.0", + "micromark-util-resolve-all": "^1.0.0", + "micromark-util-subtokenize": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.1", + "uvu": "^0.5.0" + } + }, + "node_modules/@nextcloud/vue-richtext/node_modules/micromark-factory-destination": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/micromark-factory-destination/-/micromark-factory-destination-1.1.0.tgz", + "integrity": "sha512-XaNDROBgx9SgSChd69pjiGKbV+nfHGDPVYFs5dOoDd7ZnMAE+Cuu91BCpsY8RT2NP9vo/B8pds2VQNCLiu0zhg==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-character": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.0" + } + }, + "node_modules/@nextcloud/vue-richtext/node_modules/micromark-factory-label": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/micromark-factory-label/-/micromark-factory-label-1.1.0.tgz", + "integrity": "sha512-OLtyez4vZo/1NjxGhcpDSbHQ+m0IIGnT8BoPamh+7jVlzLJBH98zzuCoUeMxvM6WsNeh8wx8cKvqLiPHEACn0w==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-character": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.0", + "uvu": "^0.5.0" + } + }, + "node_modules/@nextcloud/vue-richtext/node_modules/micromark-factory-space": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-1.1.0.tgz", + "integrity": "sha512-cRzEj7c0OL4Mw2v6nwzttyOZe8XY/Z8G0rzmWQZTBi/jjwyw/U4uqKtUORXQrR5bAZZnbTI/feRV/R7hc4jQYQ==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-character": "^1.0.0", + "micromark-util-types": "^1.0.0" + } + }, + "node_modules/@nextcloud/vue-richtext/node_modules/micromark-factory-title": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/micromark-factory-title/-/micromark-factory-title-1.1.0.tgz", + "integrity": "sha512-J7n9R3vMmgjDOCY8NPw55jiyaQnH5kBdV2/UXCtZIpnHH3P6nHUKaH7XXEYuWwx/xUJcawa8plLBEjMPU24HzQ==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-factory-space": "^1.0.0", + "micromark-util-character": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.0" + } + }, + "node_modules/@nextcloud/vue-richtext/node_modules/micromark-factory-whitespace": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/micromark-factory-whitespace/-/micromark-factory-whitespace-1.1.0.tgz", + "integrity": "sha512-v2WlmiymVSp5oMg+1Q0N1Lxmt6pMhIHD457whWM7/GUlEks1hI9xj5w3zbc4uuMKXGisksZk8DzP2UyGbGqNsQ==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-factory-space": "^1.0.0", + "micromark-util-character": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.0" + } + }, + "node_modules/@nextcloud/vue-richtext/node_modules/micromark-util-character": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-1.2.0.tgz", + "integrity": "sha512-lXraTwcX3yH/vMDaFWCQJP1uIszLVebzUa3ZHdrgxr7KEU/9mL4mVgCpGbyhvNLNlauROiNUq7WN5u7ndbY6xg==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.0" + } + }, + "node_modules/@nextcloud/vue-richtext/node_modules/micromark-util-chunked": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-chunked/-/micromark-util-chunked-1.1.0.tgz", + "integrity": "sha512-Ye01HXpkZPNcV6FiyoW2fGZDUw4Yc7vT0E9Sad83+bEDiCJ1uXu0S3mr8WLpsz3HaG3x2q0HM6CTuPdcZcluFQ==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-symbol": "^1.0.0" + } + }, + "node_modules/@nextcloud/vue-richtext/node_modules/micromark-util-classify-character": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-classify-character/-/micromark-util-classify-character-1.1.0.tgz", + "integrity": "sha512-SL0wLxtKSnklKSUplok1WQFoGhUdWYKggKUiqhX+Swala+BtptGCu5iPRc+xvzJ4PXE/hwM3FNXsfEVgoZsWbw==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-character": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.0" + } + }, + "node_modules/@nextcloud/vue-richtext/node_modules/micromark-util-combine-extensions": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-combine-extensions/-/micromark-util-combine-extensions-1.1.0.tgz", + "integrity": "sha512-Q20sp4mfNf9yEqDL50WwuWZHUrCO4fEyeDCnMGmG5Pr0Cz15Uo7KBs6jq+dq0EgX4DPwwrh9m0X+zPV1ypFvUA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-chunked": "^1.0.0", + "micromark-util-types": "^1.0.0" + } + }, + "node_modules/@nextcloud/vue-richtext/node_modules/micromark-util-decode-numeric-character-reference": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-1.1.0.tgz", + "integrity": "sha512-m9V0ExGv0jB1OT21mrWcuf4QhP46pH1KkfWy9ZEezqHKAxkj4mPCy3nIH1rkbdMlChLHX531eOrymlwyZIf2iw==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-symbol": "^1.0.0" + } + }, + "node_modules/@nextcloud/vue-richtext/node_modules/micromark-util-decode-string": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-decode-string/-/micromark-util-decode-string-1.1.0.tgz", + "integrity": "sha512-YphLGCK8gM1tG1bd54azwyrQRjCFcmgj2S2GoJDNnh4vYtnL38JS8M4gpxzOPNyHdNEpheyWXCTnnTDY3N+NVQ==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "decode-named-character-reference": "^1.0.0", + "micromark-util-character": "^1.0.0", + "micromark-util-decode-numeric-character-reference": "^1.0.0", + "micromark-util-symbol": "^1.0.0" + } + }, + "node_modules/@nextcloud/vue-richtext/node_modules/micromark-util-encode": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-1.1.0.tgz", + "integrity": "sha512-EuEzTWSTAj9PA5GOAs992GzNh2dGQO52UvAbtSOMvXTxv3Criqb6IOzJUBCmEqrrXSblJIJBbFFv6zPxpreiJw==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT" + }, + "node_modules/@nextcloud/vue-richtext/node_modules/micromark-util-html-tag-name": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/micromark-util-html-tag-name/-/micromark-util-html-tag-name-1.2.0.tgz", + "integrity": "sha512-VTQzcuQgFUD7yYztuQFKXT49KghjtETQ+Wv/zUjGSGBioZnkA4P1XXZPT1FHeJA6RwRXSF47yvJ1tsJdoxwO+Q==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT" + }, + "node_modules/@nextcloud/vue-richtext/node_modules/micromark-util-normalize-identifier": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-normalize-identifier/-/micromark-util-normalize-identifier-1.1.0.tgz", + "integrity": "sha512-N+w5vhqrBihhjdpM8+5Xsxy71QWqGn7HYNUvch71iV2PM7+E3uWGox1Qp90loa1ephtCxG2ftRV/Conitc6P2Q==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-symbol": "^1.0.0" + } + }, + "node_modules/@nextcloud/vue-richtext/node_modules/micromark-util-resolve-all": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-resolve-all/-/micromark-util-resolve-all-1.1.0.tgz", + "integrity": "sha512-b/G6BTMSg+bX+xVCshPTPyAu2tmA0E4X98NSR7eIbeC6ycCqCeE7wjfDIgzEbkzdEVJXRtOG4FbEm/uGbCRouA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-types": "^1.0.0" + } + }, + "node_modules/@nextcloud/vue-richtext/node_modules/micromark-util-sanitize-uri": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-1.2.0.tgz", + "integrity": "sha512-QO4GXv0XZfWey4pYFndLUKEAktKkG5kZTdUNaTAkzbuJxn2tNBOr+QtxR2XpWaMhbImT2dPzyLrPXLlPhph34A==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-character": "^1.0.0", + "micromark-util-encode": "^1.0.0", + "micromark-util-symbol": "^1.0.0" + } + }, + "node_modules/@nextcloud/vue-richtext/node_modules/micromark-util-subtokenize": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-subtokenize/-/micromark-util-subtokenize-1.1.0.tgz", + "integrity": "sha512-kUQHyzRoxvZO2PuLzMt2P/dwVsTiivCK8icYTeR+3WgbuPqfHgPPy7nFKbeqRivBvn/3N3GBiNC+JRTMSxEC7A==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-chunked": "^1.0.0", + "micromark-util-symbol": "^1.0.0", + "micromark-util-types": "^1.0.0", + "uvu": "^0.5.0" + } + }, + "node_modules/@nextcloud/vue-richtext/node_modules/micromark-util-symbol": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-1.1.0.tgz", + "integrity": "sha512-uEjpEYY6KMs1g7QfJ2eX1SQEV+ZT4rUD3UcF6l57acZvLNK7PBZL+ty82Z1qhK1/yXIY4bdx04FKMgR0g4IAag==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT" + }, + "node_modules/@nextcloud/vue-richtext/node_modules/micromark-util-types": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-1.1.0.tgz", + "integrity": "sha512-ukRBgie8TIAcacscVHSiddHjO4k/q3pnedmzMQ4iwDcK0FtFCohKOlFbaOL/mPgfnPsL3C1ZyxJa4sbWrBl3jg==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT" + }, + "node_modules/@nextcloud/vue-richtext/node_modules/node-polyfill-webpack-plugin": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/node-polyfill-webpack-plugin/-/node-polyfill-webpack-plugin-2.0.1.tgz", + "integrity": "sha512-ZUMiCnZkP1LF0Th2caY6J/eKKoA0TefpoVa68m/LQU1I/mE8rGt4fNYGgNuCcK+aG8P8P43nbeJ2RqJMOL/Y1A==", + "license": "MIT", + "dependencies": { + "assert": "^2.0.0", + "browserify-zlib": "^0.2.0", + "buffer": "^6.0.3", + "console-browserify": "^1.2.0", + "constants-browserify": "^1.0.0", + "crypto-browserify": "^3.12.0", + "domain-browser": "^4.22.0", + "events": "^3.3.0", + "filter-obj": "^2.0.2", + "https-browserify": "^1.0.0", + "os-browserify": "^0.3.0", + "path-browserify": "^1.0.1", + "process": "^0.11.10", + "punycode": "^2.1.1", + "querystring-es3": "^0.2.1", + "readable-stream": "^4.0.0", + "stream-browserify": "^3.0.0", + "stream-http": "^3.2.0", + "string_decoder": "^1.3.0", + "timers-browserify": "^2.0.12", + "tty-browserify": "^0.0.1", + "type-fest": "^2.14.0", + "url": "^0.11.0", + "util": "^0.12.4", + "vm-browserify": "^1.1.2" + }, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "webpack": ">=5" + } + }, + "node_modules/@nextcloud/vue-richtext/node_modules/remark-breaks": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/remark-breaks/-/remark-breaks-3.0.3.tgz", + "integrity": "sha512-C7VkvcUp1TPUc2eAYzsPdaUh8Xj4FSbQnYA5A9f80diApLZscTDeG7efiWP65W8hV2sEy3JuGVU0i6qr5D8Hug==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^3.0.0", + "mdast-util-newline-to-break": "^1.0.0", + "unified": "^10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/@nextcloud/vue-richtext/node_modules/remark-parse": { + "version": "10.0.2", + "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-10.0.2.tgz", + "integrity": "sha512-3ydxgHa/ZQzG8LvC7jTXccARYDcRld3VfcgIIFs7bI6vbRSxJJmzgLEIIoYKyrfhaY+ujuWaf/PJiMZXoiCXgw==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^3.0.0", + "mdast-util-from-markdown": "^1.0.0", + "unified": "^10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/@nextcloud/vue-richtext/node_modules/remark-rehype": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/remark-rehype/-/remark-rehype-10.1.0.tgz", + "integrity": "sha512-EFmR5zppdBp0WQeDVZ/b66CWJipB2q2VLNFMabzDSGR66Z2fQii83G5gTBbgGEnEEA0QRussvrFHxk1HWGJskw==", + "license": "MIT", + "dependencies": { + "@types/hast": "^2.0.0", + "@types/mdast": "^3.0.0", + "mdast-util-to-hast": "^12.1.0", + "unified": "^10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/@nextcloud/initial-state": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@nextcloud/initial-state/-/initial-state-2.2.0.tgz", - "integrity": "sha512-cDW98L5KGGgpS8pzd+05304/p80cyu8U2xSDQGa+kGPTpUFmCbv2qnO5WrwwGTauyjYijCal2bmw82VddSH+Pg==", - "license": "GPL-3.0-or-later", + "node_modules/@nextcloud/vue-richtext/node_modules/type-fest": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", + "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", + "license": "(MIT OR CC0-1.0)", "engines": { - "node": "^20.0.0", - "npm": "^10.0.0" + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@nextcloud/l10n": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@nextcloud/l10n/-/l10n-2.2.0.tgz", - "integrity": "sha512-UAM2NJcl/NR46MANSF7Gr7q8/Up672zRyGrxLpN3k4URNmWQM9upkbRME+1K3T29wPrUyOIbQu710ZjvZafqFA==", + "node_modules/@nextcloud/vue-richtext/node_modules/unified": { + "version": "10.1.2", + "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.2.tgz", + "integrity": "sha512-pUSWAi/RAnVy1Pif2kAoeWNBa3JVrx0MId2LASj8G+7AiHWoKZNTomq6LG326T68U7/e263X6fTdcXIy7XnF7Q==", + "license": "MIT", "dependencies": { - "@nextcloud/router": "^2.1.2", - "@nextcloud/typings": "^1.7.0", - "dompurify": "^3.0.3", - "escape-html": "^1.0.3", - "node-gettext": "^3.0.0" + "@types/unist": "^2.0.0", + "bail": "^2.0.0", + "extend": "^3.0.0", + "is-buffer": "^2.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^5.0.0" }, - "engines": { - "node": "^20.0.0", - "npm": "^9.0.0" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/@nextcloud/l10n/node_modules/@nextcloud/router": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/@nextcloud/router/-/router-2.2.1.tgz", - "integrity": "sha512-ZRc/WI0RaksEJMz08H/6LimIdP+1A1xTHThCYEghs7VgAKNp5917vT2OKSpG0cMRbIwk0ongFVt5FB5qjy/iFg==", + "node_modules/@nextcloud/vue-richtext/node_modules/unist-builder": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/unist-builder/-/unist-builder-3.0.1.tgz", + "integrity": "sha512-gnpOw7DIpCA0vpr6NqdPvTWnlPTApCTRzr+38E6hCWx3rz/cjo83SsKIlS1Z+L5ttScQ2AwutNnb8+tAvpb6qQ==", + "license": "MIT", "dependencies": { - "@nextcloud/typings": "^1.7.0", - "core-js": "^3.6.4" + "@types/unist": "^2.0.0" }, - "engines": { - "node": "^20.0.0", - "npm": "^10.0.0" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/@nextcloud/logger": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/@nextcloud/logger/-/logger-2.7.0.tgz", - "integrity": "sha512-DSJg9H1jT2zfr7uoP4tL5hKncyY+LOuxJzLauj0M/f6gnpoXU5WG1Zw8EFPOrRWjkC0ZE+NCqrMnITgdRRpXJQ==", + "node_modules/@nextcloud/vue-richtext/node_modules/unist-util-is": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.2.1.tgz", + "integrity": "sha512-u9njyyfEh43npf1M+yGKDGVPbY/JWEemg5nH05ncKPfi+kBbKBJoTdsogMu33uhytuLlv9y0O7GH7fEdwLdLQw==", + "license": "MIT", "dependencies": { - "@nextcloud/auth": "^2.0.0", - "core-js": "^3.6.4" + "@types/unist": "^2.0.0" }, - "engines": { - "node": "^20.0.0", - "npm": "^9.0.0" - } - }, - "node_modules/@nextcloud/paths": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/@nextcloud/paths/-/paths-2.2.1.tgz", - "integrity": "sha512-M3ShLjrxR7B48eKThLMoqbxTqTKyQXcwf9TgeXQGbCIhiHoXU6as5j8l5qNv/uZlANokVdowpuWHBi3b2+YNNA==", - "license": "GPL-3.0-or-later", - "engines": { - "node": "^20.0.0", - "npm": "^10.0.0" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/@nextcloud/router": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@nextcloud/router/-/router-3.0.1.tgz", - "integrity": "sha512-Ci/uD3x8OKHdxSqXL6gRJ+mGJOEXjeiHjj7hqsZqVTsT7kOrCjDf0/J8z5RyLlokKZ0IpSe+hGxgi3YB7Gpw3Q==", - "license": "GPL-3.0-or-later", + "node_modules/@nextcloud/vue-richtext/node_modules/unist-util-position": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.4.tgz", + "integrity": "sha512-kUBE91efOWfIVBo8xzh/uZQ7p9ffYRtUbMRZBNFYwf0RK8koUMx6dGUfwylLOKmaT2cs4wSW96QoYUSXAyEtpg==", + "license": "MIT", "dependencies": { - "@nextcloud/typings": "^1.7.0" + "@types/unist": "^2.0.0" }, - "engines": { - "node": "^20.0.0", - "npm": "^10.0.0" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/@nextcloud/sharing": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/@nextcloud/sharing/-/sharing-0.2.3.tgz", - "integrity": "sha512-hxQFOBBahbJkcmAGZFVS3943pQGSafNF6LMHmgcj0JPqExu1DWKuZvsCXZnGkaRJVcewHnZFcLAhpOf+VfcZmA==", - "license": "GPL-3.0-or-later", + "node_modules/@nextcloud/vue-richtext/node_modules/unist-util-stringify-position": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz", + "integrity": "sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==", + "license": "MIT", "dependencies": { - "@nextcloud/initial-state": "^2.2.0" + "@types/unist": "^2.0.0" }, - "engines": { - "node": "^20.0.0", - "npm": "^10.0.0" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/@nextcloud/stylelint-config": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/@nextcloud/stylelint-config/-/stylelint-config-2.4.0.tgz", - "integrity": "sha512-S/q/offcs9pwnkjSrnfvsONryCOe6e1lfK2sszN6ZtkYyXvaqi8EbQuuhaGlxCstn9oXwbXfAI6O3Y8lGrjdFg==", - "dev": true, - "engines": { - "node": "^20.0.0", - "npm": "^10.0.0" + "node_modules/@nextcloud/vue-richtext/node_modules/unist-util-visit": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.1.2.tgz", + "integrity": "sha512-MSd8OUGISqHdVvfY9TPhyK2VdUrPgxkUtWSuMHF6XAAFuL4LokseigBnZtPnJMu+FbynTkFNnFlyjxpVKujMRg==", + "license": "MIT", + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-is": "^5.0.0", + "unist-util-visit-parents": "^5.1.1" }, - "peerDependencies": { - "stylelint": "^15.6.0", - "stylelint-config-recommended-scss": "^13.1.0", - "stylelint-config-recommended-vue": "^1.1.0" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/@nextcloud/timezones": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/@nextcloud/timezones/-/timezones-0.1.1.tgz", - "integrity": "sha512-ldLuLyz605sszetnp6jy6mtlThu4ICKsZThxHIZwn6t4QzjQH3xr+k8mRU7GIvKq9egUFDqBp4gBjxm3/ROZig==", - "license": "AGPL-3.0-or-later", + "node_modules/@nextcloud/vue-richtext/node_modules/unist-util-visit-parents": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.1.3.tgz", + "integrity": "sha512-x6+y8g7wWMyQhL1iZfhIPhDAs7Xwbn9nRosDXl7qoPTSCy0yNxnKc+hWokFifWQIDGi154rdUqKvbCa4+1kLhg==", + "license": "MIT", "dependencies": { - "ical.js": "^2.0.1" + "@types/unist": "^2.0.0", + "unist-util-is": "^5.0.0" }, - "engines": { - "node": "^20.0.0", - "npm": "^10.0.0" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/@nextcloud/timezones/node_modules/ical.js": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/ical.js/-/ical.js-2.1.0.tgz", - "integrity": "sha512-BOVfrH55xQ6kpS3muGvIXIg2l7p+eoe12/oS7R5yrO3TL/j/bLsR0PR+tYQESFbyTbvGgPHn9zQ6tI4FWyuSaQ==", - "license": "MPL-2.0" - }, - "node_modules/@nextcloud/typings": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/@nextcloud/typings/-/typings-1.9.1.tgz", - "integrity": "sha512-i0l/L5gKW8EACbXHVxXM6wn3sUhY2qmnL2OijppzU4dENC7/hqySMQDer7/+cJbNSNG7uHF/Z+9JmHtDfRfuGg==", - "license": "GPL-3.0-or-later", + "node_modules/@nextcloud/vue-richtext/node_modules/vfile": { + "version": "5.3.7", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.7.tgz", + "integrity": "sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g==", + "license": "MIT", "dependencies": { - "@types/jquery": "3.5.16" + "@types/unist": "^2.0.0", + "is-buffer": "^2.0.0", + "unist-util-stringify-position": "^3.0.0", + "vfile-message": "^3.0.0" }, - "engines": { - "node": "^20.0.0", - "npm": "^10.0.0" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, - "node_modules/@nextcloud/vue": { - "version": "8.21.0", - "resolved": "https://registry.npmjs.org/@nextcloud/vue/-/vue-8.21.0.tgz", - "integrity": "sha512-at06uh2JJkn8dV3Yzyoag2z1g6omad8MZ8yKWE+9ZAGP+kaysbnI5q3lB7KXu8SVRtX3Rex8/oal0jgsbb6Spg==", - "license": "AGPL-3.0-or-later", + "node_modules/@nextcloud/vue-richtext/node_modules/vfile-message": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.4.tgz", + "integrity": "sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==", + "license": "MIT", "dependencies": { - "@floating-ui/dom": "^1.1.0", - "@linusborg/vue-simple-portal": "^0.1.5", - "@nextcloud/auth": "^2.4.0", - "@nextcloud/axios": "^2.5.0", - "@nextcloud/browser-storage": "^0.4.0", - "@nextcloud/capabilities": "^1.2.0", - "@nextcloud/event-bus": "^3.3.1", - "@nextcloud/initial-state": "^2.2.0", - "@nextcloud/l10n": "^3.1.0", - "@nextcloud/logger": "^3.0.2", - "@nextcloud/router": "^3.0.1", - "@nextcloud/sharing": "^0.2.3", - "@nextcloud/timezones": "^0.1.1", - "@nextcloud/vue-select": "^3.25.1", - "@vueuse/components": "^11.0.0", - "@vueuse/core": "^11.0.0", - "clone": "^2.1.2", - "debounce": "^2.2.0", - "dompurify": "^3.0.5", - "emoji-mart-vue-fast": "^15.0.1", - "escape-html": "^1.0.3", - "floating-vue": "^1.0.0-beta.19", - "focus-trap": "^7.4.3", - "linkify-string": "^4.0.0", - "md5": "^2.3.0", - "rehype-external-links": "^3.0.0", - "rehype-highlight": "^7.0.1", - "rehype-react": "^7.1.2", - "remark-breaks": "^4.0.0", - "remark-gfm": "^4.0.0", - "remark-parse": "^11.0.0", - "remark-rehype": "^11.0.0", - "splitpanes": "^2.4.1", - "string-length": "^5.0.1", - "striptags": "^3.2.0", - "tributejs": "^5.1.3", - "unified": "^11.0.1", - "unist-builder": "^4.0.0", - "unist-util-visit": "^5.0.0", - "vue": "^2.7.16", - "vue-color": "^2.8.1", - "vue-frag": "^1.4.3", - "vue-router": "^3.6.5", - "vue2-datepicker": "^3.11.0" + "@types/unist": "^2.0.0", + "unist-util-stringify-position": "^3.0.0" }, - "engines": { - "node": "^20.0.0", - "npm": "^10.0.0" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" } }, "node_modules/@nextcloud/vue-select": { @@ -19350,9 +20315,10 @@ } }, "node_modules/vue-material-design-icons": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/vue-material-design-icons/-/vue-material-design-icons-5.3.0.tgz", - "integrity": "sha512-wnbRh+48RwX/Gt+iqwCSdWpm0hPBwwv9F7MSouUzZ2PsphYVMJB9KkG9iGs+tgBiT57ZiurFEK07Y/rFKx+Ekg==" + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/vue-material-design-icons/-/vue-material-design-icons-5.3.1.tgz", + "integrity": "sha512-6UNEyhlTzlCeT8ZeX5WbpUGFTTPSbOoTQeoASTv7X4Ylh0pe8vltj+36VMK56KM0gG8EQVoMK/Qw/6evalg8lA==", + "license": "MIT" }, "node_modules/vue-multiselect": { "version": "2.1.8", diff --git a/package.json b/package.json index c05f7ca..6d4fce9 100644 --- a/package.json +++ b/package.json @@ -10,14 +10,16 @@ "extends @nextcloud/browserslist-config" ], "dependencies": { - "@nextcloud/axios": "^2.4.0", - "@nextcloud/dialogs": "^4.2.5", + "@nextcloud/axios": "^2.5.1", + "@nextcloud/dialogs": "^4.2.7", "@nextcloud/files": "^3.1.0", - "@nextcloud/initial-state": "^2.1.0", + "@nextcloud/initial-state": "^2.2.0", "@nextcloud/l10n": "^2.2.0", - "@nextcloud/router": "^3.0.0", + "@nextcloud/router": "^3.0.1", "@nextcloud/vue": "^8.6.1", - "vue": "^2.7.16" + "@nextcloud/vue-richtext": "^2.1.0-beta.6", + "vue": "^2.7.16", + "vue-material-design-icons": "^5.3.1" }, "devDependencies": { "@nextcloud/browserslist-config": "^3.0.0", From 0b2be221ded518dc209bc09a087a54f387f4ecf4 Mon Sep 17 00:00:00 2001 From: Goh Jin Di Date: Tue, 17 Dec 2024 03:16:32 +0000 Subject: [PATCH 02/20] Fix indentation and apply coding standards, add the copyright of the original authors Signed-off-by: Goh Jin Di --- lib/Controller/SearchController.php | 51 ++++++++++------- lib/Search/SearchProvider.php | 85 ++++++++++++++++++----------- lib/Service/ApiService.php | 16 +++++- lib/Service/NetworkService.php | 25 ++++++--- lib/Settings/SettingsSection.php | 2 +- 5 files changed, 117 insertions(+), 62 deletions(-) diff --git a/lib/Controller/SearchController.php b/lib/Controller/SearchController.php index 12d3472..9d56740 100644 --- a/lib/Controller/SearchController.php +++ b/lib/Controller/SearchController.php @@ -1,5 +1,15 @@ apiService->search($this->userId, $query, $limit, $offset); - - if (isset($results['error'])) { - return new DataResponse(['error' => $results['error']], Http::STATUS_BAD_REQUEST); - } - - return new DataResponse($results); - } + public function __construct( + string $appName, + IRequest $request, + private APIService $apiService, + private ?string $userId, + ) { + parent::__construct($appName, $request); + } + + #[NoCSRFRequired] + #[NoAdminRequired] + public function searchDocuments(string $query, int $limit = 10, int $offset = 0): DataResponse { + $results = $this->apiService->search($this->userId, $query, $limit, $offset); + + if (isset($results['error'])) { + return new DataResponse(['error' => $results['error']], Http::STATUS_BAD_REQUEST); + } + + return new DataResponse($results); + } } diff --git a/lib/Search/SearchProvider.php b/lib/Search/SearchProvider.php index 6679e6b..c7c5115 100644 --- a/lib/Search/SearchProvider.php +++ b/lib/Search/SearchProvider.php @@ -1,12 +1,33 @@ + * + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * 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, version 3, + * along with this program. If not, see + * + */ declare(strict_types=1); namespace OCA\Paperless\Search; use OCA\Paperless\AppInfo\Application; -use OCA\Paperless\Service\ConfigService; use OCA\Paperless\Service\ApiService; +use OCA\Paperless\Service\ConfigService; use OCP\App\IAppManager; use OCP\IConfig; use OCP\IDateTimeFormatter; @@ -31,66 +52,66 @@ public function __construct( private IDateTimeFormatter $dateTimeFormatter, private IDateTimeZone $dateTimeZone, private ConfigService $configService, - private ApiService $apiService + private ApiService $apiService, ) { } - public function getId(): string { - return 'paperless-search-messages'; - } + public function getId(): string { + return 'paperless-search-messages'; + } - public function getName(): string { - return $this->l10n->t('Paperless Search Result'); - } + public function getName(): string { + return $this->l10n->t('Paperless Search Result'); + } - public function getOrder(string $route, array $routeParameters): int { - return 20; // Adjust priority as needed - } + public function getOrder(string $route, array $routeParameters): int { + return 20; // Adjust priority as needed + } - public function search(IUser $user, ISearchQuery $query): SearchResult { - if (!$this->appManager->isEnabledForUser(Application::APP_ID, $user)) { - return SearchResult::complete($this->getName(), []); - } + public function search(IUser $user, ISearchQuery $query): SearchResult { + if (!$this->appManager->isEnabledForUser(Application::APP_ID, $user)) { + return SearchResult::complete($this->getName(), []); + } - $limit = $query->getLimit(); + $limit = $query->getLimit(); $term = $query->getTerm(); - $offset = $query->getCursor(); + $offset = $query->getCursor(); $offset = $offset ? intval($offset) : 0; - $url = $this->config->getUserValue($user->getUID(), Application::APP_ID, 'url'); - $apiKey = $this->configService->getConfig($user->getUID(), 'token'); + $url = $this->config->getUserValue($user->getUID(), Application::APP_ID, 'url'); + $apiKey = $this->configService->getConfig($user->getUID(), 'token'); - if ($url === '' || $apiKey === '' ) { - return SearchResult::paginated($this->getName(), [], 0); - } + if ($url === '' || $apiKey === '') { + return SearchResult::paginated($this->getName(), [], 0); + } - // Call Paperless API - $searchResult = $this->apiService->searchMessages($user->getUID(), $term, $offset, $limit); + // Call Paperless API + $searchResult = $this->apiService->searchMessages($user->getUID(), $term, $offset, $limit); if (isset($searchResult['error'])) { return SearchResult::paginated($this->getName(), [], 0); } $dataEntries = $searchResult['results'] ?? []; - $formattedResults = array_map(function (array $entry) use ($url): SearchResultEntry { + $formattedResults = array_map(function (array $entry) use ($url): SearchResultEntry { $finalThumbnailUrl = $this->getThumbnailUrl($entry); $title = $entry['title'] ?? 'Untitled'; - $context = $entry['__search_hit__']['highlights'] ?? ''; - $link = $this->getLinkToPaperless($entry, $url); + $context = $entry['__search_hit__']['highlights'] ?? ''; + $link = $this->getLinkToPaperless($entry, $url); return new SearchResultEntry( $finalThumbnailUrl, $title, - strip_tags($context), - $link, + strip_tags($context), + $link, $finalThumbnailUrl === '' ? 'icon-paperless-search-fallback' : '', true ); - }, $dataEntries); + }, $dataEntries); return SearchResult::paginated( $this->getName(), $formattedResults, $offset + count($dataEntries) - ); + ); } /** @@ -99,7 +120,7 @@ public function search(IUser $user, ISearchQuery $query): SearchResult { * @return string */ protected function getLinkToPaperless(array $entry, string $url): string { - return rtrim($url, '/') . "/documents/" . ($entry['id'] ?? '#'); + return rtrim($url, '/') . '/documents/' . ($entry['id'] ?? '#'); } /** diff --git a/lib/Service/ApiService.php b/lib/Service/ApiService.php index c0168e0..86602bb 100644 --- a/lib/Service/ApiService.php +++ b/lib/Service/ApiService.php @@ -1,5 +1,19 @@ + * @author Anupam Kumar + * @author Edward Ly + * @copyright Julien Veyssier 2022 + * @copyright Anupam Kumar 2023 + * @copyright Edward Ly 2024 + */ + declare(strict_types=1); namespace OCA\Paperless\Service; @@ -77,7 +91,7 @@ public function searchMessages(string $userId, string $term, int $offset = 0, in ]); if (isset($result['error'])) { - return (array) $result; + return (array)$result; } // Sort by most recent diff --git a/lib/Service/NetworkService.php b/lib/Service/NetworkService.php index 3faef15..80e0518 100644 --- a/lib/Service/NetworkService.php +++ b/lib/Service/NetworkService.php @@ -1,20 +1,31 @@ + * @author Anupam Kumar + * @author Edward Ly + * @copyright Julien Veyssier 2022 + * @copyright Anupam Kumar 2023 + * @copyright Edward Ly 2024 + */ + declare(strict_types=1); namespace OCA\Paperless\Service; use Exception; +use GuzzleHttp\Client; use GuzzleHttp\Exception\ClientException; use GuzzleHttp\Exception\ServerException; -use GuzzleHttp\Client; use OCA\Paperless\AppInfo\Application; -use OCP\Files\File; -use OCP\Http\Client\IClient; use OCP\Http\Client\IClientService; use OCP\IConfig; use OCP\IL10N; -use OCP\PreConditionNotMetException; use Psr\Log\LoggerInterface; use Throwable; @@ -30,7 +41,7 @@ public function __construct( IClientService $clientService, private LoggerInterface $logger, private ConfigService $configService, - private IL10N $l10n + private IL10N $l10n, ) { $this->client = new Client(); } @@ -84,11 +95,11 @@ public function request(string $userId, string $endPoint, array $params = [], st return json_decode($body, true); } return $body; - } catch (ServerException | ClientException $e) { + } catch (ServerException|ClientException $e) { $body = $e->getResponse()->getBody(); $this->logger->warning('Paperless API error : ' . $body, ['app' => Application::APP_ID]); return ['error' => $e->getMessage()]; - } catch (Exception | Throwable $e) { + } catch (Exception|Throwable $e) { $this->logger->warning('Paperless API error', ['exception' => $e, 'app' => Application::APP_ID]); return ['error' => $e->getMessage()]; } diff --git a/lib/Settings/SettingsSection.php b/lib/Settings/SettingsSection.php index ff58f81..3b6613b 100644 --- a/lib/Settings/SettingsSection.php +++ b/lib/Settings/SettingsSection.php @@ -12,7 +12,7 @@ class SettingsSection implements IIconSection { public function __construct( private IURLGenerator $urlGenerator, - private IL10N $l + private IL10N $l, ) { } From d9f6a88175be780a04b29f55a798f056b8a5ce0f Mon Sep 17 00:00:00 2001 From: Goh Jin Di Date: Tue, 17 Dec 2024 03:35:29 +0000 Subject: [PATCH 03/20] Reverted package.json and package-lock.json to original state Signed-off-by: Goh Jin Di --- on package-lock.json | 670 ++++++++++++++++++++++ package-lock.json | 1294 ++++++------------------------------------ package.json | 12 +- 3 files changed, 839 insertions(+), 1137 deletions(-) create mode 100644 on package-lock.json diff --git a/on package-lock.json b/on package-lock.json new file mode 100644 index 0000000..db83ac0 --- /dev/null +++ b/on package-lock.json @@ -0,0 +1,670 @@ +commit 834ee010cd841af1dc6c625e66db80e71153fe70 (HEAD -> feature/add-search-function-for-nextcloud, origin/feature/add-search-function-for-nextcloud) +Author: Goh Jin Di +Date: Tue Dec 17 03:16:32 2024 +0000 + + Fix indentation and apply coding standards, add the copyright of the original authors + +commit 6ad6b8918a95b0b3e9079454bbb7f21f8eef5b39 (remote) +Author: Ubuntu +Date: Fri Dec 13 06:16:27 2024 +0000 + + Adding search files functionality in Paperless from Nextcloud + + Signed-off-by: Goh Jin Di + +commit 79006f8bbe2f0099557094fda844868222c6592d (origin/main, origin/HEAD, main) +Merge: ccf7e61 c2cd1f7 +Author: Kate <26026535+provokateurin@users.noreply.github.com> +Date: Sun Dec 8 08:40:06 2024 +0100 + + Merge pull request #48 from nextcloud/automated/noid/main-fix-npm-audit + + [main] Fix npm audit + +commit c2cd1f74a61994efcf66d93cb5d9f332f4c5f48a +Author: nextcloud-command +Date: Sun Dec 8 03:34:43 2024 +0000 + + fix(deps): Fix npm audit + + Signed-off-by: GitHub + +commit ccf7e6198ca6594092338be905602e659b47ca00 +Merge: 059cb9b 9e85661 +Author: Kate <26026535+provokateurin@users.noreply.github.com> +Date: Sun Nov 24 17:07:11 2024 +0100 + + Merge pull request #45 from nextcloud/automated/noid/main-fix-npm-audit + +commit 9e85661e8e9b55504379e51e8e3cbae0878b06d2 +Author: nextcloud-command +Date: Sun Nov 24 03:21:40 2024 +0000 + + fix(deps): Fix npm audit + + Signed-off-by: GitHub + +commit 059cb9b29dbaf4f9ce81078ecefadb840fe82f41 +Merge: c31b33f 40686d3 +Author: Kate <26026535+provokateurin@users.noreply.github.com> +Date: Thu Nov 7 08:13:07 2024 +0100 + + Merge pull request #47 from nextcloud/dependabot/composer/vendor-bin/psalm/symfony/process-5.4.46 + +commit 40686d3595ced1cd253baae734aab4eaa56e7012 +Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> +Date: Wed Nov 6 20:37:02 2024 +0000 + + build(deps-dev): bump symfony/process in /vendor-bin/psalm + + Bumps [symfony/process](https://github.com/symfony/process) from 5.4.39 to 5.4.46. + - [Release notes](https://github.com/symfony/process/releases) + - [Changelog](https://github.com/symfony/process/blob/7.1/CHANGELOG.md) + - [Commits](https://github.com/symfony/process/compare/v5.4.39...v5.4.46) + + --- + updated-dependencies: + - dependency-name: symfony/process + dependency-type: indirect + ... + + Signed-off-by: dependabot[bot] + +commit c31b33f0fe5ce00f4ba1d09ef5f443aa3e361dd0 +Merge: f800174 67eb457 +Author: Kate <26026535+provokateurin@users.noreply.github.com> +Date: Thu Oct 31 06:50:00 2024 +0100 + + Merge pull request #46 from nextcloud/dependabot/npm_and_yarn/elliptic-6.6.0 + +commit 67eb4572fe34400d1bd88e1c83d9c757e3c92287 +Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> +Date: Thu Oct 31 02:12:34 2024 +0000 + + build(deps): bump elliptic from 6.5.7 to 6.6.0 + + Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.7 to 6.6.0. + - [Commits](https://github.com/indutny/elliptic/compare/v6.5.7...v6.6.0) + + --- + updated-dependencies: + - dependency-name: elliptic + dependency-type: indirect + ... + + Signed-off-by: dependabot[bot] + +commit f800174dca5785934163845d77194e9150e315af +Merge: 1ce64fe c1e7b94 +Author: Kate <26026535+provokateurin@users.noreply.github.com> +Date: Sun Oct 13 08:41:33 2024 +0200 + + Merge pull request #43 from nextcloud/automated/noid/main-fix-npm-audit + +commit c1e7b94dcc6b95319837989410106e85e6c6ef7b +Author: nextcloud-command +Date: Sun Oct 13 03:25:33 2024 +0000 + + fix(deps): Fix npm audit + + Signed-off-by: GitHub + +commit 1ce64fe020418bbe101191e0b4cc7d011da29bfd +Merge: bead86d 4df02d8 +Author: Kate <26026535+provokateurin@users.noreply.github.com> +Date: Sun Sep 29 08:56:31 2024 +0200 + + Merge pull request #42 from nextcloud/automated/noid/main-fix-npm-audit + +commit 4df02d837fdddeb1909e06ec86349f6b9c1a46dd +Author: nextcloud-command +Date: Sun Sep 29 03:27:43 2024 +0000 + + fix(deps): Fix npm audit + + Signed-off-by: GitHub + +commit bead86dfc5a7267a6405c4cbb5d9b44c379261ec +Merge: 756a3e7 75f89f6 +Author: Kate <26026535+provokateurin@users.noreply.github.com> +Date: Sun Sep 22 08:23:23 2024 +0200 + + Merge pull request #41 from nextcloud/automated/noid/main-fix-npm-audit + +commit 75f89f64bfaf36aa6ee7bde33bbeb71a540c8827 +Author: nextcloud-command +Date: Sun Sep 22 03:24:41 2024 +0000 + + fix(deps): Fix npm audit + + Signed-off-by: GitHub + +commit 756a3e79bdf4601fe9d1f3cc27026e2dcbccf271 +Merge: c1ec8cd cac5bcd +Author: Kate <26026535+provokateurin@users.noreply.github.com> +Date: Wed Sep 18 10:14:40 2024 +0200 + + Merge pull request #39 from nextcloud/chore/release/v1.0.4 + +commit cac5bcd90d7d29908cdc4d05522e5815c6be06fc +Author: provokateurin +Date: Wed Sep 18 10:10:24 2024 +0200 + + chore(release): v1.0.4 + + Signed-off-by: provokateurin + +commit c3b7dca9c98d060a706e3ba10e890c02d9fa2345 +Author: provokateurin +Date: Wed Sep 18 10:09:56 2024 +0200 + + build: Add Nextcloud 30 support + + Signed-off-by: provokateurin + +commit c1ec8cd97af8ecc85ebfc8b64c6fad1b5f2b3e98 +Merge: a08f36b 7d143f5 +Author: Kate <26026535+provokateurin@users.noreply.github.com> +Date: Sun Sep 15 07:22:45 2024 +0200 + + Merge pull request #38 from nextcloud/automated/noid/main-fix-npm-audit + +commit 7d143f51ed01b83ae76e30a4a061906a963905b6 +Author: nextcloud-command +Date: Sun Sep 15 03:18:30 2024 +0000 + + fix(deps): Fix npm audit + + Signed-off-by: GitHub + +commit a08f36b499893c89d7e94699fe1428c6f7fc1f2c +Merge: 9cba303 7c8fb51 +Author: Kate <26026535+provokateurin@users.noreply.github.com> +Date: Sat Aug 31 08:21:25 2024 +0200 + + Merge pull request #35 from nextcloud/dependabot/npm_and_yarn/webpack-5.94.0 + +commit 7c8fb5149dee79194add4357c676eaca3cbcd053 +Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> +Date: Sat Aug 31 02:42:17 2024 +0000 + + build(deps): bump webpack from 5.90.3 to 5.94.0 + + Bumps [webpack](https://github.com/webpack/webpack) from 5.90.3 to 5.94.0. + - [Release notes](https://github.com/webpack/webpack/releases) + - [Commits](https://github.com/webpack/webpack/compare/v5.90.3...v5.94.0) + + --- + updated-dependencies: + - dependency-name: webpack + dependency-type: indirect + ... + + Signed-off-by: dependabot[bot] + +commit 9cba3035a0dad55aa888e89a4f453642c33c5697 +Merge: 1f0e6e6 04a31ea +Author: Kate <26026535+provokateurin@users.noreply.github.com> +Date: Sun Aug 25 13:36:05 2024 +0200 + + Merge pull request #33 from nextcloud/automated/noid/main-fix-npm-audit + +commit 04a31eafd1179504d91528c5f891c6f5b475122b +Author: nextcloud-command +Date: Sun Aug 25 03:00:10 2024 +0000 + + fix(deps): Fix npm audit + + Signed-off-by: GitHub + +commit 1f0e6e689f60625b591caed8ce387bf83505b630 +Merge: 6860e86 27b855e +Author: Kate <26026535+provokateurin@users.noreply.github.com> +Date: Fri Aug 23 14:38:33 2024 +0200 + + Merge pull request #32 from nextcloud/automated/update-workflows/default + +commit 27b855eeb8e4accf9388875113bfcd21c4281271 +Author: skjnldsv +Date: Thu Aug 22 22:22:40 2024 +0200 + + chore: update workflows from templates + + Signed-off-by: skjnldsv + +commit 6860e86332f5164c786640dcd988cdedfee3cc9f +Merge: 12fed51 8c7194f +Author: Kate <26026535+provokateurin@users.noreply.github.com> +Date: Sun Aug 18 06:58:52 2024 +0200 + + Merge pull request #31 from nextcloud/automated/noid/main-fix-npm-audit + +commit 8c7194f9841dee53d0fda7ad94600003c0b7d194 +Author: nextcloud-command +Date: Sun Aug 18 03:01:10 2024 +0000 + + fix(deps): Fix npm audit + + Signed-off-by: GitHub + +commit 12fed512ec632e4bc0b0f8075ab4bff89b9e6a08 +Merge: d7dc93c 37b88e0 +Author: Kate <26026535+provokateurin@users.noreply.github.com> +Date: Sun Aug 11 18:11:02 2024 +0200 + + Merge pull request #30 from nextcloud/automated/noid/main-fix-npm-audit + +commit 37b88e071609696d0a14c4fe4d8f59d7af60934b +Author: nextcloud-command +Date: Sun Aug 11 03:06:56 2024 +0000 + + fix(deps): Fix npm audit + + Signed-off-by: GitHub + +commit d7dc93c0f3562ee9feab6c8e8db827cec28fabdf +Merge: 9a5e202 92d2796 +Author: Kate <26026535+provokateurin@users.noreply.github.com> +Date: Tue Jul 30 08:46:58 2024 +0200 + + Merge pull request #29 from nextcloud/dependabot/npm_and_yarn/fast-xml-parser-4.4.1 + +commit 92d2796ec9be85f7340ef21217b2e6c78e44ab1c +Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> +Date: Mon Jul 29 22:12:46 2024 +0000 + + build(deps): bump fast-xml-parser from 4.3.4 to 4.4.1 + + Bumps [fast-xml-parser](https://github.com/NaturalIntelligence/fast-xml-parser) from 4.3.4 to 4.4.1. + - [Release notes](https://github.com/NaturalIntelligence/fast-xml-parser/releases) + - [Changelog](https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/CHANGELOG.md) + - [Commits](https://github.com/NaturalIntelligence/fast-xml-parser/compare/v4.3.4...v4.4.1) + + --- + updated-dependencies: + - dependency-name: fast-xml-parser + dependency-type: indirect + ... + + Signed-off-by: dependabot[bot] + +commit 9a5e202ff9c34b75ad3eafcde01f24252bf31a9c +Merge: f6eb62c a2718a8 +Author: Andy Scherzinger +Date: Sat Jul 13 14:27:13 2024 +0200 + + Merge pull request #26 from nextcloud/automated/update-workflows/default + + chore: update workflows from templates + +commit a2718a81b2ed004c48aa923778c77fe50561f0b7 +Author: skjnldsv +Date: Sat Jul 13 10:41:23 2024 +0200 + + chore: update workflows from templates + + Signed-off-by: skjnldsv + +commit f6eb62cf82f2795f77454816e32316bf4dc38267 +Merge: 0b4ac80 bb33527 +Author: Kate <26026535+provokateurin@users.noreply.github.com> +Date: Wed Jun 19 06:53:33 2024 +0200 + + Merge pull request #24 from nextcloud/dependabot/npm_and_yarn/ws-8.17.1 + +commit bb33527f39401161065cdbb8219ecccd18f706d7 +Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> +Date: Tue Jun 18 22:56:09 2024 +0000 + + build(deps-dev): bump ws from 8.16.0 to 8.17.1 + + Bumps [ws](https://github.com/websockets/ws) from 8.16.0 to 8.17.1. + - [Release notes](https://github.com/websockets/ws/releases) + - [Commits](https://github.com/websockets/ws/compare/8.16.0...8.17.1) + + --- + updated-dependencies: + - dependency-name: ws + dependency-type: indirect + ... + + Signed-off-by: dependabot[bot] + +commit 0b4ac806bcabec3f0bcfd4e5ce9ec664139bed5f +Merge: 70cfd72 f16329f +Author: Kate <26026535+provokateurin@users.noreply.github.com> +Date: Sun Jun 16 08:29:13 2024 +0200 + + Merge pull request #23 from nextcloud/automated/noid/main-fix-npm-audit + +commit f16329f2917a9a637849fef1e3e8b68464b657da +Author: nextcloud-command +Date: Sun Jun 16 03:11:47 2024 +0000 + + fix(deps): fix npm audit + + Signed-off-by: GitHub + +commit 70cfd72d7ba66688959f64f380e01bb8d47eddc8 +Author: provokateurin +Date: Fri May 10 07:03:22 2024 +0200 + + chore(release): v1.0.3 + + Signed-off-by: provokateurin + +commit 24f692071327d3c00ff0167f053b01f92d32812c +Merge: f1530a8 1bc8fb1 +Author: Kate <26026535+provokateurin@users.noreply.github.com> +Date: Fri May 10 07:02:23 2024 +0200 + + Merge pull request #21 from nextcloud/fix/minimum-28 + +commit 1bc8fb1d15b232287df3ff2e8f752e815cba63b0 +Author: provokateurin +Date: Fri May 10 06:52:09 2024 +0200 + + fix: Set minimum Nextcloud version to 28 due to incompatibilities + + Signed-off-by: provokateurin + +commit f1530a832c49073c5be8a55c89195ec95a5b364f +Author: provokateurin +Date: Fri May 3 08:07:47 2024 +0200 + + chore(release): v1.0.2 + + Signed-off-by: provokateurin + +commit 155817ec3aaf267269b342469fab8e163a8b71de +Merge: ac0afb5 362da64 +Author: Kate <26026535+provokateurin@users.noreply.github.com> +Date: Fri May 3 08:06:03 2024 +0200 + + Merge pull request #19 from nextcloud/feat/appinfo/screenshot + +commit 362da64406e205d5b1ceb82f12c50bb57ba334c1 +Author: provokateurin +Date: Fri May 3 08:03:25 2024 +0200 + + feat(appinfo): Add screenshot for Appstore + + Signed-off-by: provokateurin + +commit 7354afeafe4e5252d02992059460099877d29f0f +Author: provokateurin +Date: Fri May 3 08:01:40 2024 +0200 + + fix(changelog): Format according to keep a changelog convention + + Signed-off-by: provokateurin + +commit ac0afb5be5c29256a3a77e62d963b52adf4e48a9 +Merge: 02aeba4 370991f +Author: Kate <26026535+provokateurin@users.noreply.github.com> +Date: Tue Apr 23 14:39:01 2024 +0200 + + Merge pull request #13 from nextcloud/dependabot/npm_and_yarn/follow-redirects-1.15.6 + +commit 02aeba490f5caa0a93fc7c84ad6e3a279e39c5a2 +Merge: 42b2a13 424e9e0 +Author: Kate <26026535+provokateurin@users.noreply.github.com> +Date: Tue Apr 23 14:38:52 2024 +0200 + + Merge pull request #15 from nextcloud/dependabot/npm_and_yarn/webpack-dev-middleware-5.3.4 + +commit 42b2a133966632efcaeed8618d55827d281f87e9 +Merge: eeee175 b87fd5d +Author: Kate <26026535+provokateurin@users.noreply.github.com> +Date: Tue Apr 23 14:38:43 2024 +0200 + + Merge pull request #16 from nextcloud/dependabot/npm_and_yarn/express-4.19.2 + +commit eeee175a0b6745c3101b0223c3942590eb2df4f7 +Merge: 8a17e0a 9d7de09 +Author: Kate <26026535+provokateurin@users.noreply.github.com> +Date: Tue Apr 23 14:38:29 2024 +0200 + + Merge pull request #14 from nextcloud/automated/noid/main-fix-npm-audit + +commit 9d7de093aa56291abe093277a7efb0a2c05c0e74 +Author: nextcloud-command +Date: Sun Apr 14 04:26:32 2024 +0000 + + fix(deps): fix npm audit + + Signed-off-by: GitHub + +commit b87fd5d118efb50fdd991cc3d98791a6e36a3acc +Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> +Date: Fri Mar 29 18:13:52 2024 +0000 + + build(deps-dev): bump express from 4.18.2 to 4.19.2 + + Bumps [express](https://github.com/expressjs/express) from 4.18.2 to 4.19.2. + - [Release notes](https://github.com/expressjs/express/releases) + - [Changelog](https://github.com/expressjs/express/blob/master/History.md) + - [Commits](https://github.com/expressjs/express/compare/4.18.2...4.19.2) + + --- + updated-dependencies: + - dependency-name: express + dependency-type: indirect + ... + + Signed-off-by: dependabot[bot] + +commit 424e9e06eb8c64149194fbb8971e6c9784e3bf60 +Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> +Date: Sun Mar 24 00:50:41 2024 +0000 + + build(deps-dev): bump webpack-dev-middleware from 5.3.3 to 5.3.4 + + Bumps [webpack-dev-middleware](https://github.com/webpack/webpack-dev-middleware) from 5.3.3 to 5.3.4. + - [Release notes](https://github.com/webpack/webpack-dev-middleware/releases) + - [Changelog](https://github.com/webpack/webpack-dev-middleware/blob/v5.3.4/CHANGELOG.md) + - [Commits](https://github.com/webpack/webpack-dev-middleware/compare/v5.3.3...v5.3.4) + + --- + updated-dependencies: + - dependency-name: webpack-dev-middleware + dependency-type: indirect + ... + + Signed-off-by: dependabot[bot] + +commit 370991fa8135b86238e2d4336203ad060f2f7a2f +Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> +Date: Sun Mar 17 00:33:44 2024 +0000 + + build(deps): bump follow-redirects from 1.15.5 to 1.15.6 + + Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.5 to 1.15.6. + - [Release notes](https://github.com/follow-redirects/follow-redirects/releases) + - [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.15.5...v1.15.6) + + --- + updated-dependencies: + - dependency-name: follow-redirects + dependency-type: indirect + ... + + Signed-off-by: dependabot[bot] + +commit 8a17e0a804e3bd0bd7350864756dd6820d7d1d10 +Merge: 889d1e4 73c1cca +Author: Kate <26026535+provokateurin@users.noreply.github.com> +Date: Fri Mar 15 09:46:52 2024 +0100 + + Merge pull request #9 from nextcloud/chore/release/1.0.1 + +commit 73c1ccae7c94ed245ca84580f44cf4dc0ecad0fd +Author: provokateurin +Date: Fri Mar 15 09:44:08 2024 +0100 + + chore(release): v1.0.1 + + Signed-off-by: provokateurin + +commit 889d1e41ccfe9cab45b88b3c413bc696a2077630 +Merge: 70d30e4 6cd3dcc +Author: Kate <26026535+provokateurin@users.noreply.github.com> +Date: Fri Mar 15 09:39:44 2024 +0100 + + Merge pull request #8 from nextcloud/chore/docs/update-app-description + +commit 6cd3dccde2511b4042c021d7f14bef5f047abcac +Author: provokateurin +Date: Fri Mar 15 09:37:02 2024 +0100 + + chore(docs): Update app description + + Signed-off-by: provokateurin + +commit 70d30e486cc4d8243f5aad725014bc2adbe512fd +Merge: db6f38f 4b2f31c +Author: Kate <26026535+provokateurin@users.noreply.github.com> +Date: Fri Mar 15 09:34:04 2024 +0100 + + Merge pull request #7 from nextcloud/build/krankerl-config + +commit db6f38f941376d69ae7fdd997f85b38db07254d8 +Merge: bc03c95 b7d240e +Author: Kate <26026535+provokateurin@users.noreply.github.com> +Date: Fri Mar 15 09:29:49 2024 +0100 + + Merge pull request #6 from nextcloud/chore/remove-makefile + +commit 4b2f31c42291dba0c16cb7f5c70976dbb26c1991 +Author: provokateurin +Date: Fri Mar 15 09:29:29 2024 +0100 + + build: Add krankerl config + + Signed-off-by: provokateurin + +commit b7d240e2fa4d34b9c4b9e8bfe24194e0a14dd80e +Author: provokateurin +Date: Fri Mar 15 09:27:04 2024 +0100 + + chore: Remove Makefile + + Signed-off-by: provokateurin + +commit bc03c95f60ffe3b2f220ad6c3e62068376fa833f +Merge: 93e7a76 171604a +Author: Kate <26026535+provokateurin@users.noreply.github.com> +Date: Mon Mar 11 15:59:23 2024 +0100 + + Merge pull request #4 from nextcloud/automated/update-workflows/default + +commit 171604a0b172d8cc73cf9c41040a826cb04ab536 +Author: skjnldsv +Date: Fri Mar 8 20:57:12 2024 +0100 + + chore: update workflows from templates + + Signed-off-by: skjnldsv + +commit 93e7a7689d5c5fda216663c2a81f8e8a29dc0396 +Author: provokateurin +Date: Mon Mar 11 15:56:30 2024 +0100 + + ci: Run psalm against stable28 + + Signed-off-by: provokateurin + +commit 91c8d0552a792eaa1593eb5f85ed5d9220b0038f +Author: provokateurin +Date: Mon Mar 11 15:48:30 2024 +0100 + + fix(composer): Force PHP 8.0 compatibility + + Signed-off-by: provokateurin + +commit 332b872f67580c1bb04c2fc31513085706a743ea +Author: provokateurin +Date: Mon Mar 11 15:00:04 2024 +0100 + + fix: Run psalm single threaded + + Signed-off-by: provokateurin + +commit 11aa22edf85b8d6fedaa0f3ffcc6ba2a255ac1c7 +Author: provokateurin +Date: Mon Mar 11 14:55:35 2024 +0100 + + chore: Correctly format composer.json + + Signed-off-by: provokateurin + +commit 13b1b3f7b944744a824bcb3b5c358a516cd40aca +Merge: 597ee5b b06d561 +Author: Kate <26026535+provokateurin@users.noreply.github.com> +Date: Mon Mar 11 14:44:53 2024 +0100 + + Merge pull request #5 from nextcloud/fix/composer-bin + +commit b06d561a2367ab27ebf6c6356fe2318a3da706bd +Author: provokateurin +Date: Mon Mar 11 14:42:30 2024 +0100 + + fix: Install composer bin plugin on non-dev environments + + Signed-off-by: provokateurin + +commit 597ee5b53230d0ca264af9ec1cee71becdd96a0b +Author: MB-Finski +Date: Fri Mar 1 10:05:41 2024 +0000 + + Add app description + + Signed-off-by: MB-Finski + +commit 73be729470f62ef6cde494a9c459aacb100e6408 +Author: MB-Finski +Date: Tue Feb 27 08:45:27 2024 +0000 + + Add bin script for non-dev environments + + Signed-off-by: MB-Finski + +commit 9cbb3e30c93496373f34de4224d102cfd58cac0b +Author: MB-Finski +Date: Mon Feb 26 12:22:20 2024 +0000 + + Add makefile + + Signed-off-by: MB-Finski + +commit 12ea44bf78d8d6c929dc20a384759a3d4cd4444f +Author: MB-Finski +Date: Mon Feb 26 12:11:29 2024 +0000 + + Add appstore publish workflow + + Signed-off-by: MB-Finski + +commit 21bfdbf32751382550dd2e3ed3e9a4caa9171d20 +Author: provokateurin +Date: Tue Feb 20 13:52:12 2024 +0100 + + chore: fix composer.json + + Signed-off-by: provokateurin + +commit 799b033f7742114701db6042ecb4abd9507eca81 +Author: provokateurin +Date: Tue Feb 20 13:39:29 2024 +0100 + + fix: Configure composer bin plugin correctly + + Signed-off-by: provokateurin + +commit 34923410bfa1f6fa7812db2051e2f027a68be210 +Author: provokateurin +Date: Tue Feb 20 11:55:51 2024 +0100 + + Initial commit + + Signed-off-by: provokateurin diff --git a/package-lock.json b/package-lock.json index 6e748de..bb15db6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,16 +9,14 @@ "version": "1.0.0", "license": "AGPL-3.0-or-later", "dependencies": { - "@nextcloud/axios": "^2.5.1", - "@nextcloud/dialogs": "^4.2.7", + "@nextcloud/axios": "^2.4.0", + "@nextcloud/dialogs": "^4.2.5", "@nextcloud/files": "^3.1.0", - "@nextcloud/initial-state": "^2.2.0", + "@nextcloud/initial-state": "^2.1.0", "@nextcloud/l10n": "^2.2.0", - "@nextcloud/router": "^3.0.1", + "@nextcloud/router": "^3.0.0", "@nextcloud/vue": "^8.6.1", - "@nextcloud/vue-richtext": "^2.1.0-beta.6", - "vue": "^2.7.16", - "vue-material-design-icons": "^5.3.1" + "vue": "^2.7.16" }, "devDependencies": { "@nextcloud/browserslist-config": "^3.0.0", @@ -3081,1163 +3079,200 @@ "dependencies": { "@nextcloud/auth": "^2.3.0" }, - "engines": { - "node": "^20.0.0", - "npm": "^10.0.0" - } - }, - "node_modules/@nextcloud/initial-state": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@nextcloud/initial-state/-/initial-state-2.2.0.tgz", - "integrity": "sha512-cDW98L5KGGgpS8pzd+05304/p80cyu8U2xSDQGa+kGPTpUFmCbv2qnO5WrwwGTauyjYijCal2bmw82VddSH+Pg==", - "license": "GPL-3.0-or-later", - "engines": { - "node": "^20.0.0", - "npm": "^10.0.0" - } - }, - "node_modules/@nextcloud/l10n": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@nextcloud/l10n/-/l10n-2.2.0.tgz", - "integrity": "sha512-UAM2NJcl/NR46MANSF7Gr7q8/Up672zRyGrxLpN3k4URNmWQM9upkbRME+1K3T29wPrUyOIbQu710ZjvZafqFA==", - "license": "GPL-3.0-or-later", - "dependencies": { - "@nextcloud/router": "^2.1.2", - "@nextcloud/typings": "^1.7.0", - "dompurify": "^3.0.3", - "escape-html": "^1.0.3", - "node-gettext": "^3.0.0" - }, - "engines": { - "node": "^20.0.0", - "npm": "^9.0.0" - } - }, - "node_modules/@nextcloud/l10n/node_modules/@nextcloud/router": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/@nextcloud/router/-/router-2.2.1.tgz", - "integrity": "sha512-ZRc/WI0RaksEJMz08H/6LimIdP+1A1xTHThCYEghs7VgAKNp5917vT2OKSpG0cMRbIwk0ongFVt5FB5qjy/iFg==", - "dependencies": { - "@nextcloud/typings": "^1.7.0", - "core-js": "^3.6.4" - }, - "engines": { - "node": "^20.0.0", - "npm": "^10.0.0" - } - }, - "node_modules/@nextcloud/logger": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/@nextcloud/logger/-/logger-2.7.0.tgz", - "integrity": "sha512-DSJg9H1jT2zfr7uoP4tL5hKncyY+LOuxJzLauj0M/f6gnpoXU5WG1Zw8EFPOrRWjkC0ZE+NCqrMnITgdRRpXJQ==", - "dependencies": { - "@nextcloud/auth": "^2.0.0", - "core-js": "^3.6.4" - }, - "engines": { - "node": "^20.0.0", - "npm": "^9.0.0" - } - }, - "node_modules/@nextcloud/paths": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/@nextcloud/paths/-/paths-2.2.1.tgz", - "integrity": "sha512-M3ShLjrxR7B48eKThLMoqbxTqTKyQXcwf9TgeXQGbCIhiHoXU6as5j8l5qNv/uZlANokVdowpuWHBi3b2+YNNA==", - "license": "GPL-3.0-or-later", - "engines": { - "node": "^20.0.0", - "npm": "^10.0.0" - } - }, - "node_modules/@nextcloud/router": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@nextcloud/router/-/router-3.0.1.tgz", - "integrity": "sha512-Ci/uD3x8OKHdxSqXL6gRJ+mGJOEXjeiHjj7hqsZqVTsT7kOrCjDf0/J8z5RyLlokKZ0IpSe+hGxgi3YB7Gpw3Q==", - "license": "GPL-3.0-or-later", - "dependencies": { - "@nextcloud/typings": "^1.7.0" - }, - "engines": { - "node": "^20.0.0", - "npm": "^10.0.0" - } - }, - "node_modules/@nextcloud/sharing": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/@nextcloud/sharing/-/sharing-0.2.3.tgz", - "integrity": "sha512-hxQFOBBahbJkcmAGZFVS3943pQGSafNF6LMHmgcj0JPqExu1DWKuZvsCXZnGkaRJVcewHnZFcLAhpOf+VfcZmA==", - "license": "GPL-3.0-or-later", - "dependencies": { - "@nextcloud/initial-state": "^2.2.0" - }, - "engines": { - "node": "^20.0.0", - "npm": "^10.0.0" - } - }, - "node_modules/@nextcloud/stylelint-config": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/@nextcloud/stylelint-config/-/stylelint-config-2.4.0.tgz", - "integrity": "sha512-S/q/offcs9pwnkjSrnfvsONryCOe6e1lfK2sszN6ZtkYyXvaqi8EbQuuhaGlxCstn9oXwbXfAI6O3Y8lGrjdFg==", - "dev": true, - "engines": { - "node": "^20.0.0", - "npm": "^10.0.0" - }, - "peerDependencies": { - "stylelint": "^15.6.0", - "stylelint-config-recommended-scss": "^13.1.0", - "stylelint-config-recommended-vue": "^1.1.0" - } - }, - "node_modules/@nextcloud/timezones": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/@nextcloud/timezones/-/timezones-0.1.1.tgz", - "integrity": "sha512-ldLuLyz605sszetnp6jy6mtlThu4ICKsZThxHIZwn6t4QzjQH3xr+k8mRU7GIvKq9egUFDqBp4gBjxm3/ROZig==", - "license": "AGPL-3.0-or-later", - "dependencies": { - "ical.js": "^2.0.1" - }, - "engines": { - "node": "^20.0.0", - "npm": "^10.0.0" - } - }, - "node_modules/@nextcloud/timezones/node_modules/ical.js": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/ical.js/-/ical.js-2.1.0.tgz", - "integrity": "sha512-BOVfrH55xQ6kpS3muGvIXIg2l7p+eoe12/oS7R5yrO3TL/j/bLsR0PR+tYQESFbyTbvGgPHn9zQ6tI4FWyuSaQ==", - "license": "MPL-2.0" - }, - "node_modules/@nextcloud/typings": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/@nextcloud/typings/-/typings-1.9.1.tgz", - "integrity": "sha512-i0l/L5gKW8EACbXHVxXM6wn3sUhY2qmnL2OijppzU4dENC7/hqySMQDer7/+cJbNSNG7uHF/Z+9JmHtDfRfuGg==", - "license": "GPL-3.0-or-later", - "dependencies": { - "@types/jquery": "3.5.16" - }, - "engines": { - "node": "^20.0.0", - "npm": "^10.0.0" - } - }, - "node_modules/@nextcloud/vue": { - "version": "8.21.0", - "resolved": "https://registry.npmjs.org/@nextcloud/vue/-/vue-8.21.0.tgz", - "integrity": "sha512-at06uh2JJkn8dV3Yzyoag2z1g6omad8MZ8yKWE+9ZAGP+kaysbnI5q3lB7KXu8SVRtX3Rex8/oal0jgsbb6Spg==", - "license": "AGPL-3.0-or-later", - "dependencies": { - "@floating-ui/dom": "^1.1.0", - "@linusborg/vue-simple-portal": "^0.1.5", - "@nextcloud/auth": "^2.4.0", - "@nextcloud/axios": "^2.5.0", - "@nextcloud/browser-storage": "^0.4.0", - "@nextcloud/capabilities": "^1.2.0", - "@nextcloud/event-bus": "^3.3.1", - "@nextcloud/initial-state": "^2.2.0", - "@nextcloud/l10n": "^3.1.0", - "@nextcloud/logger": "^3.0.2", - "@nextcloud/router": "^3.0.1", - "@nextcloud/sharing": "^0.2.3", - "@nextcloud/timezones": "^0.1.1", - "@nextcloud/vue-select": "^3.25.1", - "@vueuse/components": "^11.0.0", - "@vueuse/core": "^11.0.0", - "clone": "^2.1.2", - "debounce": "^2.2.0", - "dompurify": "^3.0.5", - "emoji-mart-vue-fast": "^15.0.1", - "escape-html": "^1.0.3", - "floating-vue": "^1.0.0-beta.19", - "focus-trap": "^7.4.3", - "linkify-string": "^4.0.0", - "md5": "^2.3.0", - "rehype-external-links": "^3.0.0", - "rehype-highlight": "^7.0.1", - "rehype-react": "^7.1.2", - "remark-breaks": "^4.0.0", - "remark-gfm": "^4.0.0", - "remark-parse": "^11.0.0", - "remark-rehype": "^11.0.0", - "splitpanes": "^2.4.1", - "string-length": "^5.0.1", - "striptags": "^3.2.0", - "tributejs": "^5.1.3", - "unified": "^11.0.1", - "unist-builder": "^4.0.0", - "unist-util-visit": "^5.0.0", - "vue": "^2.7.16", - "vue-color": "^2.8.1", - "vue-frag": "^1.4.3", - "vue-router": "^3.6.5", - "vue2-datepicker": "^3.11.0" - }, - "engines": { - "node": "^20.0.0", - "npm": "^10.0.0" - } - }, - "node_modules/@nextcloud/vue-richtext": { - "version": "2.1.0-beta.6", - "resolved": "https://registry.npmjs.org/@nextcloud/vue-richtext/-/vue-richtext-2.1.0-beta.6.tgz", - "integrity": "sha512-LIhBCpFEfimUCHlPuhRADwTDXwOf4SASaQLYowofwvFfqTBjYi/TZdQfP4UBPaVFP2aKssOxuZ3HT83Z77ROAw==", - "license": "AGPL-3.0", - "dependencies": { - "@nextcloud/axios": "^2.0.0", - "@nextcloud/event-bus": "^3.0.2", - "@nextcloud/initial-state": "^2.0.0", - "@nextcloud/router": "^2.0.0", - "@nextcloud/vue": "^7.5.0", - "clone": "^2.1.2", - "vue": "^2.7.8", - "vue-material-design-icons": "^5.1.2" - }, - "engines": { - "node": ">=14.0.0", - "npm": ">=7.0.0" - }, - "peerDependencies": { - "vue": "^2.7.8" - } - }, - "node_modules/@nextcloud/vue-richtext/node_modules/@nextcloud/browser-storage": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@nextcloud/browser-storage/-/browser-storage-0.2.0.tgz", - "integrity": "sha512-qRetNoCMHzfJyuQ7uvlwUXNwXlm5eSy4h8hI0Oa9HKbej57WGBYxRqsHElFzipSPh7mBUdFnz5clGpzIQx8+HQ==", - "license": "GPL-3.0-or-later", - "dependencies": { - "core-js": "3.25.5" - }, - "engines": { - "node": "^16.0.0", - "npm": "^7.0.0 || ^8.0.0" - } - }, - "node_modules/@nextcloud/vue-richtext/node_modules/@nextcloud/router": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/@nextcloud/router/-/router-2.2.1.tgz", - "integrity": "sha512-ZRc/WI0RaksEJMz08H/6LimIdP+1A1xTHThCYEghs7VgAKNp5917vT2OKSpG0cMRbIwk0ongFVt5FB5qjy/iFg==", - "license": "GPL-3.0-or-later", - "dependencies": { - "@nextcloud/typings": "^1.7.0", - "core-js": "^3.6.4" - }, - "engines": { - "node": "^20.0.0", - "npm": "^10.0.0" - } - }, - "node_modules/@nextcloud/vue-richtext/node_modules/@nextcloud/vue": { - "version": "7.12.8", - "resolved": "https://registry.npmjs.org/@nextcloud/vue/-/vue-7.12.8.tgz", - "integrity": "sha512-qNLQJE8XH4PpmYDTuBkXLiJ0ZZ34Rh25iWEWIcFG8wE3gKj3hKxQXbkJFoZWE8eBFi4TJsmvd/PGixII2S35DQ==", - "license": "AGPL-3.0-or-later", - "dependencies": { - "@floating-ui/dom": "^1.1.0", - "@nextcloud/auth": "^2.0.0", - "@nextcloud/axios": "^2.0.0", - "@nextcloud/browser-storage": "^0.2.0", - "@nextcloud/calendar-js": "^6.0.0", - "@nextcloud/capabilities": "^1.0.4", - "@nextcloud/dialogs": "^4.0.0", - "@nextcloud/event-bus": "^3.0.0", - "@nextcloud/initial-state": "^2.0.0", - "@nextcloud/l10n": "^2.0.1", - "@nextcloud/logger": "^2.2.1", - "@nextcloud/router": "^2.0.0", - "@nextcloud/vue-select": "^3.21.2", - "@skjnldsv/sanitize-svg": "^1.0.2", - "@vueuse/components": "^10.0.2", - "clone": "^2.1.2", - "debounce": "1.2.1", - "emoji-mart-vue-fast": "^12.0.1", - "escape-html": "^1.0.3", - "floating-vue": "^1.0.0-beta.19", - "focus-trap": "^7.4.3", - "hammerjs": "^2.0.8", - "linkify-string": "^4.0.0", - "md5": "^2.3.0", - "node-polyfill-webpack-plugin": "^2.0.1", - "rehype-external-links": "^3.0.0", - "rehype-react": "^7.1.2", - "remark-breaks": "^3.0.2", - "remark-parse": "^10.0.1", - "remark-rehype": "^10.1.0", - "splitpanes": "^2.4.1", - "string-length": "^5.0.1", - "striptags": "^3.2.0", - "tributejs": "^5.1.3", - "unified": "^10.1.2", - "unist-builder": "^3.0.1", - "unist-util-visit": "^4.1.2", - "vue": "^2.7.14", - "vue-color": "^2.8.1", - "vue-frag": "^1.4.3", - "vue-material-design-icons": "^5.1.2", - "vue-multiselect": "^2.1.6", - "vue2-datepicker": "^3.11.0" - }, - "engines": { - "node": "^16.0.0", - "npm": "^7.0.0 || ^8.0.0" - } - }, - "node_modules/@nextcloud/vue-richtext/node_modules/@types/hast": { - "version": "2.3.10", - "resolved": "https://registry.npmjs.org/@types/hast/-/hast-2.3.10.tgz", - "integrity": "sha512-McWspRw8xx8J9HurkVBfYj0xKoE25tOFlHGdx4MJ5xORQrMGZNqJhVQWaIbm6Oyla5kYOXtDiopzKRJzEOkwJw==", - "license": "MIT", - "dependencies": { - "@types/unist": "^2" - } - }, - "node_modules/@nextcloud/vue-richtext/node_modules/@types/mdast": { - "version": "3.0.15", - "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-3.0.15.tgz", - "integrity": "sha512-LnwD+mUEfxWMa1QpDraczIn6k0Ee3SMicuYSSzS6ZYl2gKS09EClnJYGd8Du6rfc5r/GZEk5o1mRb8TaTj03sQ==", - "license": "MIT", - "dependencies": { - "@types/unist": "^2" - } - }, - "node_modules/@nextcloud/vue-richtext/node_modules/@types/unist": { - "version": "2.0.11", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.11.tgz", - "integrity": "sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA==", - "license": "MIT" - }, - "node_modules/@nextcloud/vue-richtext/node_modules/core-js": { - "version": "3.25.5", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.25.5.tgz", - "integrity": "sha512-nbm6eZSjm+ZuBQxCUPQKQCoUEfFOXjUZ8dTTyikyKaWrTYmAVbykQfwsKE5dBK88u3QCkCrzsx/PPlKfhsvgpw==", - "hasInstallScript": true, - "license": "MIT", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/core-js" - } - }, - "node_modules/@nextcloud/vue-richtext/node_modules/debounce": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/debounce/-/debounce-1.2.1.tgz", - "integrity": "sha512-XRRe6Glud4rd/ZGQfiV1ruXSfbvfJedlV9Y6zOlP+2K04vBYiJEte6stfFkCP03aMnY5tsipamumUjL14fofug==", - "license": "MIT" - }, - "node_modules/@nextcloud/vue-richtext/node_modules/emoji-mart-vue-fast": { - "version": "12.0.5", - "resolved": "https://registry.npmjs.org/emoji-mart-vue-fast/-/emoji-mart-vue-fast-12.0.5.tgz", - "integrity": "sha512-XFNwIk+ConSAjC4tmk//s6btlo3oQco7TBgP914Qytg/15jLa/0VrWNg271W2MTv+8N8BxYl2dDn3cZJxcreqw==", - "license": "BSD-3-Clause", - "dependencies": { - "@babel/runtime": "^7.18.6", - "core-js": "^3.23.5" - }, - "peerDependencies": { - "vue": ">2.0.0" - } - }, - "node_modules/@nextcloud/vue-richtext/node_modules/escape-string-regexp": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", - "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@nextcloud/vue-richtext/node_modules/is-buffer": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz", - "integrity": "sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "node_modules/@nextcloud/vue-richtext/node_modules/is-plain-obj": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz", - "integrity": "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==", - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@nextcloud/vue-richtext/node_modules/mdast-util-find-and-replace": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/mdast-util-find-and-replace/-/mdast-util-find-and-replace-2.2.2.tgz", - "integrity": "sha512-MTtdFRz/eMDHXzeK6W3dO7mXUlF82Gom4y0oOgvHhh/HXZAGvIQDUvQ0SuUx+j2tv44b8xTHOm8K/9OoRFnXKw==", - "license": "MIT", - "dependencies": { - "@types/mdast": "^3.0.0", - "escape-string-regexp": "^5.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/@nextcloud/vue-richtext/node_modules/mdast-util-from-markdown": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-1.3.1.tgz", - "integrity": "sha512-4xTO/M8c82qBcnQc1tgpNtubGUW/Y1tBQ1B0i5CtSoelOLKFYlElIr3bvgREYYO5iRqbMY1YuqZng0GVOI8Qww==", - "license": "MIT", - "dependencies": { - "@types/mdast": "^3.0.0", - "@types/unist": "^2.0.0", - "decode-named-character-reference": "^1.0.0", - "mdast-util-to-string": "^3.1.0", - "micromark": "^3.0.0", - "micromark-util-decode-numeric-character-reference": "^1.0.0", - "micromark-util-decode-string": "^1.0.0", - "micromark-util-normalize-identifier": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0", - "unist-util-stringify-position": "^3.0.0", - "uvu": "^0.5.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/@nextcloud/vue-richtext/node_modules/mdast-util-newline-to-break": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/mdast-util-newline-to-break/-/mdast-util-newline-to-break-1.0.0.tgz", - "integrity": "sha512-491LcYv3gbGhhCrLoeALncQmega2xPh+m3gbsIhVsOX4sw85+ShLFPvPyibxc1Swx/6GtzxgVodq+cGa/47ULg==", - "license": "MIT", - "dependencies": { - "@types/mdast": "^3.0.0", - "mdast-util-find-and-replace": "^2.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/@nextcloud/vue-richtext/node_modules/mdast-util-to-hast": { - "version": "12.3.0", - "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-12.3.0.tgz", - "integrity": "sha512-pits93r8PhnIoU4Vy9bjW39M2jJ6/tdHyja9rrot9uujkN7UTU9SDnE6WNJz/IGyQk3XHX6yNNtrBH6cQzm8Hw==", - "license": "MIT", - "dependencies": { - "@types/hast": "^2.0.0", - "@types/mdast": "^3.0.0", - "mdast-util-definitions": "^5.0.0", - "micromark-util-sanitize-uri": "^1.1.0", - "trim-lines": "^3.0.0", - "unist-util-generated": "^2.0.0", - "unist-util-position": "^4.0.0", - "unist-util-visit": "^4.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/@nextcloud/vue-richtext/node_modules/mdast-util-to-string": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-3.2.0.tgz", - "integrity": "sha512-V4Zn/ncyN1QNSqSBxTrMOLpjr+IKdHl2v3KVLoWmDPscP4r9GcCi71gjgvUV1SFSKh92AjAG4peFuBl2/YgCJg==", - "license": "MIT", - "dependencies": { - "@types/mdast": "^3.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/@nextcloud/vue-richtext/node_modules/micromark": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/micromark/-/micromark-3.2.0.tgz", - "integrity": "sha512-uD66tJj54JLYq0De10AhWycZWGQNUvDI55xPgk2sQM5kn1JYlhbCMTtEeT27+vAhW2FBQxLlOmS3pmA7/2z4aA==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "@types/debug": "^4.0.0", - "debug": "^4.0.0", - "decode-named-character-reference": "^1.0.0", - "micromark-core-commonmark": "^1.0.1", - "micromark-factory-space": "^1.0.0", - "micromark-util-character": "^1.0.0", - "micromark-util-chunked": "^1.0.0", - "micromark-util-combine-extensions": "^1.0.0", - "micromark-util-decode-numeric-character-reference": "^1.0.0", - "micromark-util-encode": "^1.0.0", - "micromark-util-normalize-identifier": "^1.0.0", - "micromark-util-resolve-all": "^1.0.0", - "micromark-util-sanitize-uri": "^1.0.0", - "micromark-util-subtokenize": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.1", - "uvu": "^0.5.0" - } - }, - "node_modules/@nextcloud/vue-richtext/node_modules/micromark-core-commonmark": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-1.1.0.tgz", - "integrity": "sha512-BgHO1aRbolh2hcrzL2d1La37V0Aoz73ymF8rAcKnohLy93titmv62E0gP8Hrx9PKcKrqCZ1BbLGbP3bEhoXYlw==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "decode-named-character-reference": "^1.0.0", - "micromark-factory-destination": "^1.0.0", - "micromark-factory-label": "^1.0.0", - "micromark-factory-space": "^1.0.0", - "micromark-factory-title": "^1.0.0", - "micromark-factory-whitespace": "^1.0.0", - "micromark-util-character": "^1.0.0", - "micromark-util-chunked": "^1.0.0", - "micromark-util-classify-character": "^1.0.0", - "micromark-util-html-tag-name": "^1.0.0", - "micromark-util-normalize-identifier": "^1.0.0", - "micromark-util-resolve-all": "^1.0.0", - "micromark-util-subtokenize": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.1", - "uvu": "^0.5.0" - } - }, - "node_modules/@nextcloud/vue-richtext/node_modules/micromark-factory-destination": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-factory-destination/-/micromark-factory-destination-1.1.0.tgz", - "integrity": "sha512-XaNDROBgx9SgSChd69pjiGKbV+nfHGDPVYFs5dOoDd7ZnMAE+Cuu91BCpsY8RT2NP9vo/B8pds2VQNCLiu0zhg==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "micromark-util-character": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0" - } - }, - "node_modules/@nextcloud/vue-richtext/node_modules/micromark-factory-label": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-factory-label/-/micromark-factory-label-1.1.0.tgz", - "integrity": "sha512-OLtyez4vZo/1NjxGhcpDSbHQ+m0IIGnT8BoPamh+7jVlzLJBH98zzuCoUeMxvM6WsNeh8wx8cKvqLiPHEACn0w==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "micromark-util-character": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0", - "uvu": "^0.5.0" - } - }, - "node_modules/@nextcloud/vue-richtext/node_modules/micromark-factory-space": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-1.1.0.tgz", - "integrity": "sha512-cRzEj7c0OL4Mw2v6nwzttyOZe8XY/Z8G0rzmWQZTBi/jjwyw/U4uqKtUORXQrR5bAZZnbTI/feRV/R7hc4jQYQ==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "micromark-util-character": "^1.0.0", - "micromark-util-types": "^1.0.0" - } - }, - "node_modules/@nextcloud/vue-richtext/node_modules/micromark-factory-title": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-factory-title/-/micromark-factory-title-1.1.0.tgz", - "integrity": "sha512-J7n9R3vMmgjDOCY8NPw55jiyaQnH5kBdV2/UXCtZIpnHH3P6nHUKaH7XXEYuWwx/xUJcawa8plLBEjMPU24HzQ==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "micromark-factory-space": "^1.0.0", - "micromark-util-character": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0" - } - }, - "node_modules/@nextcloud/vue-richtext/node_modules/micromark-factory-whitespace": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-factory-whitespace/-/micromark-factory-whitespace-1.1.0.tgz", - "integrity": "sha512-v2WlmiymVSp5oMg+1Q0N1Lxmt6pMhIHD457whWM7/GUlEks1hI9xj5w3zbc4uuMKXGisksZk8DzP2UyGbGqNsQ==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "micromark-factory-space": "^1.0.0", - "micromark-util-character": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0" - } - }, - "node_modules/@nextcloud/vue-richtext/node_modules/micromark-util-character": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-1.2.0.tgz", - "integrity": "sha512-lXraTwcX3yH/vMDaFWCQJP1uIszLVebzUa3ZHdrgxr7KEU/9mL4mVgCpGbyhvNLNlauROiNUq7WN5u7ndbY6xg==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0" - } - }, - "node_modules/@nextcloud/vue-richtext/node_modules/micromark-util-chunked": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-chunked/-/micromark-util-chunked-1.1.0.tgz", - "integrity": "sha512-Ye01HXpkZPNcV6FiyoW2fGZDUw4Yc7vT0E9Sad83+bEDiCJ1uXu0S3mr8WLpsz3HaG3x2q0HM6CTuPdcZcluFQ==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "micromark-util-symbol": "^1.0.0" - } - }, - "node_modules/@nextcloud/vue-richtext/node_modules/micromark-util-classify-character": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-classify-character/-/micromark-util-classify-character-1.1.0.tgz", - "integrity": "sha512-SL0wLxtKSnklKSUplok1WQFoGhUdWYKggKUiqhX+Swala+BtptGCu5iPRc+xvzJ4PXE/hwM3FNXsfEVgoZsWbw==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "micromark-util-character": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0" - } - }, - "node_modules/@nextcloud/vue-richtext/node_modules/micromark-util-combine-extensions": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-combine-extensions/-/micromark-util-combine-extensions-1.1.0.tgz", - "integrity": "sha512-Q20sp4mfNf9yEqDL50WwuWZHUrCO4fEyeDCnMGmG5Pr0Cz15Uo7KBs6jq+dq0EgX4DPwwrh9m0X+zPV1ypFvUA==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "micromark-util-chunked": "^1.0.0", - "micromark-util-types": "^1.0.0" - } - }, - "node_modules/@nextcloud/vue-richtext/node_modules/micromark-util-decode-numeric-character-reference": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-1.1.0.tgz", - "integrity": "sha512-m9V0ExGv0jB1OT21mrWcuf4QhP46pH1KkfWy9ZEezqHKAxkj4mPCy3nIH1rkbdMlChLHX531eOrymlwyZIf2iw==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "micromark-util-symbol": "^1.0.0" - } - }, - "node_modules/@nextcloud/vue-richtext/node_modules/micromark-util-decode-string": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-decode-string/-/micromark-util-decode-string-1.1.0.tgz", - "integrity": "sha512-YphLGCK8gM1tG1bd54azwyrQRjCFcmgj2S2GoJDNnh4vYtnL38JS8M4gpxzOPNyHdNEpheyWXCTnnTDY3N+NVQ==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "decode-named-character-reference": "^1.0.0", - "micromark-util-character": "^1.0.0", - "micromark-util-decode-numeric-character-reference": "^1.0.0", - "micromark-util-symbol": "^1.0.0" - } - }, - "node_modules/@nextcloud/vue-richtext/node_modules/micromark-util-encode": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-1.1.0.tgz", - "integrity": "sha512-EuEzTWSTAj9PA5GOAs992GzNh2dGQO52UvAbtSOMvXTxv3Criqb6IOzJUBCmEqrrXSblJIJBbFFv6zPxpreiJw==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT" - }, - "node_modules/@nextcloud/vue-richtext/node_modules/micromark-util-html-tag-name": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/micromark-util-html-tag-name/-/micromark-util-html-tag-name-1.2.0.tgz", - "integrity": "sha512-VTQzcuQgFUD7yYztuQFKXT49KghjtETQ+Wv/zUjGSGBioZnkA4P1XXZPT1FHeJA6RwRXSF47yvJ1tsJdoxwO+Q==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT" - }, - "node_modules/@nextcloud/vue-richtext/node_modules/micromark-util-normalize-identifier": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-normalize-identifier/-/micromark-util-normalize-identifier-1.1.0.tgz", - "integrity": "sha512-N+w5vhqrBihhjdpM8+5Xsxy71QWqGn7HYNUvch71iV2PM7+E3uWGox1Qp90loa1ephtCxG2ftRV/Conitc6P2Q==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "micromark-util-symbol": "^1.0.0" - } - }, - "node_modules/@nextcloud/vue-richtext/node_modules/micromark-util-resolve-all": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-resolve-all/-/micromark-util-resolve-all-1.1.0.tgz", - "integrity": "sha512-b/G6BTMSg+bX+xVCshPTPyAu2tmA0E4X98NSR7eIbeC6ycCqCeE7wjfDIgzEbkzdEVJXRtOG4FbEm/uGbCRouA==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "micromark-util-types": "^1.0.0" - } - }, - "node_modules/@nextcloud/vue-richtext/node_modules/micromark-util-sanitize-uri": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-1.2.0.tgz", - "integrity": "sha512-QO4GXv0XZfWey4pYFndLUKEAktKkG5kZTdUNaTAkzbuJxn2tNBOr+QtxR2XpWaMhbImT2dPzyLrPXLlPhph34A==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "micromark-util-character": "^1.0.0", - "micromark-util-encode": "^1.0.0", - "micromark-util-symbol": "^1.0.0" - } - }, - "node_modules/@nextcloud/vue-richtext/node_modules/micromark-util-subtokenize": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-subtokenize/-/micromark-util-subtokenize-1.1.0.tgz", - "integrity": "sha512-kUQHyzRoxvZO2PuLzMt2P/dwVsTiivCK8icYTeR+3WgbuPqfHgPPy7nFKbeqRivBvn/3N3GBiNC+JRTMSxEC7A==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT", - "dependencies": { - "micromark-util-chunked": "^1.0.0", - "micromark-util-symbol": "^1.0.0", - "micromark-util-types": "^1.0.0", - "uvu": "^0.5.0" - } - }, - "node_modules/@nextcloud/vue-richtext/node_modules/micromark-util-symbol": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-1.1.0.tgz", - "integrity": "sha512-uEjpEYY6KMs1g7QfJ2eX1SQEV+ZT4rUD3UcF6l57acZvLNK7PBZL+ty82Z1qhK1/yXIY4bdx04FKMgR0g4IAag==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT" - }, - "node_modules/@nextcloud/vue-richtext/node_modules/micromark-util-types": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-1.1.0.tgz", - "integrity": "sha512-ukRBgie8TIAcacscVHSiddHjO4k/q3pnedmzMQ4iwDcK0FtFCohKOlFbaOL/mPgfnPsL3C1ZyxJa4sbWrBl3jg==", - "funding": [ - { - "type": "GitHub Sponsors", - "url": "https://github.com/sponsors/unifiedjs" - }, - { - "type": "OpenCollective", - "url": "https://opencollective.com/unified" - } - ], - "license": "MIT" - }, - "node_modules/@nextcloud/vue-richtext/node_modules/node-polyfill-webpack-plugin": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/node-polyfill-webpack-plugin/-/node-polyfill-webpack-plugin-2.0.1.tgz", - "integrity": "sha512-ZUMiCnZkP1LF0Th2caY6J/eKKoA0TefpoVa68m/LQU1I/mE8rGt4fNYGgNuCcK+aG8P8P43nbeJ2RqJMOL/Y1A==", - "license": "MIT", - "dependencies": { - "assert": "^2.0.0", - "browserify-zlib": "^0.2.0", - "buffer": "^6.0.3", - "console-browserify": "^1.2.0", - "constants-browserify": "^1.0.0", - "crypto-browserify": "^3.12.0", - "domain-browser": "^4.22.0", - "events": "^3.3.0", - "filter-obj": "^2.0.2", - "https-browserify": "^1.0.0", - "os-browserify": "^0.3.0", - "path-browserify": "^1.0.1", - "process": "^0.11.10", - "punycode": "^2.1.1", - "querystring-es3": "^0.2.1", - "readable-stream": "^4.0.0", - "stream-browserify": "^3.0.0", - "stream-http": "^3.2.0", - "string_decoder": "^1.3.0", - "timers-browserify": "^2.0.12", - "tty-browserify": "^0.0.1", - "type-fest": "^2.14.0", - "url": "^0.11.0", - "util": "^0.12.4", - "vm-browserify": "^1.1.2" - }, - "engines": { - "node": ">=12" - }, - "peerDependencies": { - "webpack": ">=5" - } - }, - "node_modules/@nextcloud/vue-richtext/node_modules/remark-breaks": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/remark-breaks/-/remark-breaks-3.0.3.tgz", - "integrity": "sha512-C7VkvcUp1TPUc2eAYzsPdaUh8Xj4FSbQnYA5A9f80diApLZscTDeG7efiWP65W8hV2sEy3JuGVU0i6qr5D8Hug==", - "license": "MIT", - "dependencies": { - "@types/mdast": "^3.0.0", - "mdast-util-newline-to-break": "^1.0.0", - "unified": "^10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/@nextcloud/vue-richtext/node_modules/remark-parse": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-10.0.2.tgz", - "integrity": "sha512-3ydxgHa/ZQzG8LvC7jTXccARYDcRld3VfcgIIFs7bI6vbRSxJJmzgLEIIoYKyrfhaY+ujuWaf/PJiMZXoiCXgw==", - "license": "MIT", - "dependencies": { - "@types/mdast": "^3.0.0", - "mdast-util-from-markdown": "^1.0.0", - "unified": "^10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" - } - }, - "node_modules/@nextcloud/vue-richtext/node_modules/remark-rehype": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/remark-rehype/-/remark-rehype-10.1.0.tgz", - "integrity": "sha512-EFmR5zppdBp0WQeDVZ/b66CWJipB2q2VLNFMabzDSGR66Z2fQii83G5gTBbgGEnEEA0QRussvrFHxk1HWGJskw==", - "license": "MIT", - "dependencies": { - "@types/hast": "^2.0.0", - "@types/mdast": "^3.0.0", - "mdast-util-to-hast": "^12.1.0", - "unified": "^10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "engines": { + "node": "^20.0.0", + "npm": "^10.0.0" } }, - "node_modules/@nextcloud/vue-richtext/node_modules/type-fest": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", - "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", - "license": "(MIT OR CC0-1.0)", + "node_modules/@nextcloud/initial-state": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@nextcloud/initial-state/-/initial-state-2.2.0.tgz", + "integrity": "sha512-cDW98L5KGGgpS8pzd+05304/p80cyu8U2xSDQGa+kGPTpUFmCbv2qnO5WrwwGTauyjYijCal2bmw82VddSH+Pg==", + "license": "GPL-3.0-or-later", "engines": { - "node": ">=12.20" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": "^20.0.0", + "npm": "^10.0.0" } }, - "node_modules/@nextcloud/vue-richtext/node_modules/unified": { - "version": "10.1.2", - "resolved": "https://registry.npmjs.org/unified/-/unified-10.1.2.tgz", - "integrity": "sha512-pUSWAi/RAnVy1Pif2kAoeWNBa3JVrx0MId2LASj8G+7AiHWoKZNTomq6LG326T68U7/e263X6fTdcXIy7XnF7Q==", - "license": "MIT", + "node_modules/@nextcloud/l10n": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@nextcloud/l10n/-/l10n-2.2.0.tgz", + "integrity": "sha512-UAM2NJcl/NR46MANSF7Gr7q8/Up672zRyGrxLpN3k4URNmWQM9upkbRME+1K3T29wPrUyOIbQu710ZjvZafqFA==", "dependencies": { - "@types/unist": "^2.0.0", - "bail": "^2.0.0", - "extend": "^3.0.0", - "is-buffer": "^2.0.0", - "is-plain-obj": "^4.0.0", - "trough": "^2.0.0", - "vfile": "^5.0.0" + "@nextcloud/router": "^2.1.2", + "@nextcloud/typings": "^1.7.0", + "dompurify": "^3.0.3", + "escape-html": "^1.0.3", + "node-gettext": "^3.0.0" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "engines": { + "node": "^20.0.0", + "npm": "^9.0.0" } }, - "node_modules/@nextcloud/vue-richtext/node_modules/unist-builder": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/unist-builder/-/unist-builder-3.0.1.tgz", - "integrity": "sha512-gnpOw7DIpCA0vpr6NqdPvTWnlPTApCTRzr+38E6hCWx3rz/cjo83SsKIlS1Z+L5ttScQ2AwutNnb8+tAvpb6qQ==", - "license": "MIT", + "node_modules/@nextcloud/l10n/node_modules/@nextcloud/router": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@nextcloud/router/-/router-2.2.1.tgz", + "integrity": "sha512-ZRc/WI0RaksEJMz08H/6LimIdP+1A1xTHThCYEghs7VgAKNp5917vT2OKSpG0cMRbIwk0ongFVt5FB5qjy/iFg==", "dependencies": { - "@types/unist": "^2.0.0" + "@nextcloud/typings": "^1.7.0", + "core-js": "^3.6.4" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "engines": { + "node": "^20.0.0", + "npm": "^10.0.0" } }, - "node_modules/@nextcloud/vue-richtext/node_modules/unist-util-is": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-5.2.1.tgz", - "integrity": "sha512-u9njyyfEh43npf1M+yGKDGVPbY/JWEemg5nH05ncKPfi+kBbKBJoTdsogMu33uhytuLlv9y0O7GH7fEdwLdLQw==", - "license": "MIT", + "node_modules/@nextcloud/logger": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/@nextcloud/logger/-/logger-2.7.0.tgz", + "integrity": "sha512-DSJg9H1jT2zfr7uoP4tL5hKncyY+LOuxJzLauj0M/f6gnpoXU5WG1Zw8EFPOrRWjkC0ZE+NCqrMnITgdRRpXJQ==", "dependencies": { - "@types/unist": "^2.0.0" + "@nextcloud/auth": "^2.0.0", + "core-js": "^3.6.4" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "engines": { + "node": "^20.0.0", + "npm": "^9.0.0" } }, - "node_modules/@nextcloud/vue-richtext/node_modules/unist-util-position": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-4.0.4.tgz", - "integrity": "sha512-kUBE91efOWfIVBo8xzh/uZQ7p9ffYRtUbMRZBNFYwf0RK8koUMx6dGUfwylLOKmaT2cs4wSW96QoYUSXAyEtpg==", - "license": "MIT", + "node_modules/@nextcloud/paths": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@nextcloud/paths/-/paths-2.2.1.tgz", + "integrity": "sha512-M3ShLjrxR7B48eKThLMoqbxTqTKyQXcwf9TgeXQGbCIhiHoXU6as5j8l5qNv/uZlANokVdowpuWHBi3b2+YNNA==", + "license": "GPL-3.0-or-later", + "engines": { + "node": "^20.0.0", + "npm": "^10.0.0" + } + }, + "node_modules/@nextcloud/router": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@nextcloud/router/-/router-3.0.1.tgz", + "integrity": "sha512-Ci/uD3x8OKHdxSqXL6gRJ+mGJOEXjeiHjj7hqsZqVTsT7kOrCjDf0/J8z5RyLlokKZ0IpSe+hGxgi3YB7Gpw3Q==", + "license": "GPL-3.0-or-later", "dependencies": { - "@types/unist": "^2.0.0" + "@nextcloud/typings": "^1.7.0" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "engines": { + "node": "^20.0.0", + "npm": "^10.0.0" } }, - "node_modules/@nextcloud/vue-richtext/node_modules/unist-util-stringify-position": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-3.0.3.tgz", - "integrity": "sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg==", - "license": "MIT", + "node_modules/@nextcloud/sharing": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@nextcloud/sharing/-/sharing-0.2.3.tgz", + "integrity": "sha512-hxQFOBBahbJkcmAGZFVS3943pQGSafNF6LMHmgcj0JPqExu1DWKuZvsCXZnGkaRJVcewHnZFcLAhpOf+VfcZmA==", + "license": "GPL-3.0-or-later", "dependencies": { - "@types/unist": "^2.0.0" + "@nextcloud/initial-state": "^2.2.0" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "engines": { + "node": "^20.0.0", + "npm": "^10.0.0" } }, - "node_modules/@nextcloud/vue-richtext/node_modules/unist-util-visit": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-4.1.2.tgz", - "integrity": "sha512-MSd8OUGISqHdVvfY9TPhyK2VdUrPgxkUtWSuMHF6XAAFuL4LokseigBnZtPnJMu+FbynTkFNnFlyjxpVKujMRg==", - "license": "MIT", - "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0", - "unist-util-visit-parents": "^5.1.1" + "node_modules/@nextcloud/stylelint-config": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@nextcloud/stylelint-config/-/stylelint-config-2.4.0.tgz", + "integrity": "sha512-S/q/offcs9pwnkjSrnfvsONryCOe6e1lfK2sszN6ZtkYyXvaqi8EbQuuhaGlxCstn9oXwbXfAI6O3Y8lGrjdFg==", + "dev": true, + "engines": { + "node": "^20.0.0", + "npm": "^10.0.0" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "peerDependencies": { + "stylelint": "^15.6.0", + "stylelint-config-recommended-scss": "^13.1.0", + "stylelint-config-recommended-vue": "^1.1.0" } }, - "node_modules/@nextcloud/vue-richtext/node_modules/unist-util-visit-parents": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-5.1.3.tgz", - "integrity": "sha512-x6+y8g7wWMyQhL1iZfhIPhDAs7Xwbn9nRosDXl7qoPTSCy0yNxnKc+hWokFifWQIDGi154rdUqKvbCa4+1kLhg==", - "license": "MIT", + "node_modules/@nextcloud/timezones": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@nextcloud/timezones/-/timezones-0.1.1.tgz", + "integrity": "sha512-ldLuLyz605sszetnp6jy6mtlThu4ICKsZThxHIZwn6t4QzjQH3xr+k8mRU7GIvKq9egUFDqBp4gBjxm3/ROZig==", + "license": "AGPL-3.0-or-later", "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-is": "^5.0.0" + "ical.js": "^2.0.1" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "engines": { + "node": "^20.0.0", + "npm": "^10.0.0" } }, - "node_modules/@nextcloud/vue-richtext/node_modules/vfile": { - "version": "5.3.7", - "resolved": "https://registry.npmjs.org/vfile/-/vfile-5.3.7.tgz", - "integrity": "sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g==", - "license": "MIT", + "node_modules/@nextcloud/timezones/node_modules/ical.js": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/ical.js/-/ical.js-2.1.0.tgz", + "integrity": "sha512-BOVfrH55xQ6kpS3muGvIXIg2l7p+eoe12/oS7R5yrO3TL/j/bLsR0PR+tYQESFbyTbvGgPHn9zQ6tI4FWyuSaQ==", + "license": "MPL-2.0" + }, + "node_modules/@nextcloud/typings": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@nextcloud/typings/-/typings-1.9.1.tgz", + "integrity": "sha512-i0l/L5gKW8EACbXHVxXM6wn3sUhY2qmnL2OijppzU4dENC7/hqySMQDer7/+cJbNSNG7uHF/Z+9JmHtDfRfuGg==", + "license": "GPL-3.0-or-later", "dependencies": { - "@types/unist": "^2.0.0", - "is-buffer": "^2.0.0", - "unist-util-stringify-position": "^3.0.0", - "vfile-message": "^3.0.0" + "@types/jquery": "3.5.16" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "engines": { + "node": "^20.0.0", + "npm": "^10.0.0" } }, - "node_modules/@nextcloud/vue-richtext/node_modules/vfile-message": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-3.1.4.tgz", - "integrity": "sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==", - "license": "MIT", + "node_modules/@nextcloud/vue": { + "version": "8.21.0", + "resolved": "https://registry.npmjs.org/@nextcloud/vue/-/vue-8.21.0.tgz", + "integrity": "sha512-at06uh2JJkn8dV3Yzyoag2z1g6omad8MZ8yKWE+9ZAGP+kaysbnI5q3lB7KXu8SVRtX3Rex8/oal0jgsbb6Spg==", + "license": "AGPL-3.0-or-later", "dependencies": { - "@types/unist": "^2.0.0", - "unist-util-stringify-position": "^3.0.0" + "@floating-ui/dom": "^1.1.0", + "@linusborg/vue-simple-portal": "^0.1.5", + "@nextcloud/auth": "^2.4.0", + "@nextcloud/axios": "^2.5.0", + "@nextcloud/browser-storage": "^0.4.0", + "@nextcloud/capabilities": "^1.2.0", + "@nextcloud/event-bus": "^3.3.1", + "@nextcloud/initial-state": "^2.2.0", + "@nextcloud/l10n": "^3.1.0", + "@nextcloud/logger": "^3.0.2", + "@nextcloud/router": "^3.0.1", + "@nextcloud/sharing": "^0.2.3", + "@nextcloud/timezones": "^0.1.1", + "@nextcloud/vue-select": "^3.25.1", + "@vueuse/components": "^11.0.0", + "@vueuse/core": "^11.0.0", + "clone": "^2.1.2", + "debounce": "^2.2.0", + "dompurify": "^3.0.5", + "emoji-mart-vue-fast": "^15.0.1", + "escape-html": "^1.0.3", + "floating-vue": "^1.0.0-beta.19", + "focus-trap": "^7.4.3", + "linkify-string": "^4.0.0", + "md5": "^2.3.0", + "rehype-external-links": "^3.0.0", + "rehype-highlight": "^7.0.1", + "rehype-react": "^7.1.2", + "remark-breaks": "^4.0.0", + "remark-gfm": "^4.0.0", + "remark-parse": "^11.0.0", + "remark-rehype": "^11.0.0", + "splitpanes": "^2.4.1", + "string-length": "^5.0.1", + "striptags": "^3.2.0", + "tributejs": "^5.1.3", + "unified": "^11.0.1", + "unist-builder": "^4.0.0", + "unist-util-visit": "^5.0.0", + "vue": "^2.7.16", + "vue-color": "^2.8.1", + "vue-frag": "^1.4.3", + "vue-router": "^3.6.5", + "vue2-datepicker": "^3.11.0" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/unified" + "engines": { + "node": "^20.0.0", + "npm": "^10.0.0" } }, "node_modules/@nextcloud/vue-select": { @@ -20315,10 +19350,9 @@ } }, "node_modules/vue-material-design-icons": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/vue-material-design-icons/-/vue-material-design-icons-5.3.1.tgz", - "integrity": "sha512-6UNEyhlTzlCeT8ZeX5WbpUGFTTPSbOoTQeoASTv7X4Ylh0pe8vltj+36VMK56KM0gG8EQVoMK/Qw/6evalg8lA==", - "license": "MIT" + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/vue-material-design-icons/-/vue-material-design-icons-5.3.0.tgz", + "integrity": "sha512-wnbRh+48RwX/Gt+iqwCSdWpm0hPBwwv9F7MSouUzZ2PsphYVMJB9KkG9iGs+tgBiT57ZiurFEK07Y/rFKx+Ekg==" }, "node_modules/vue-multiselect": { "version": "2.1.8", diff --git a/package.json b/package.json index 6d4fce9..c05f7ca 100644 --- a/package.json +++ b/package.json @@ -10,16 +10,14 @@ "extends @nextcloud/browserslist-config" ], "dependencies": { - "@nextcloud/axios": "^2.5.1", - "@nextcloud/dialogs": "^4.2.7", + "@nextcloud/axios": "^2.4.0", + "@nextcloud/dialogs": "^4.2.5", "@nextcloud/files": "^3.1.0", - "@nextcloud/initial-state": "^2.2.0", + "@nextcloud/initial-state": "^2.1.0", "@nextcloud/l10n": "^2.2.0", - "@nextcloud/router": "^3.0.1", + "@nextcloud/router": "^3.0.0", "@nextcloud/vue": "^8.6.1", - "@nextcloud/vue-richtext": "^2.1.0-beta.6", - "vue": "^2.7.16", - "vue-material-design-icons": "^5.3.1" + "vue": "^2.7.16" }, "devDependencies": { "@nextcloud/browserslist-config": "^3.0.0", From 80c192c939925b919f04a357b94bf83794a46ee0 Mon Sep 17 00:00:00 2001 From: Goh Jin Di Date: Tue, 17 Dec 2024 08:13:43 +0000 Subject: [PATCH 04/20] Modified ApiService.php, implement the call directly like it is done in sendFile(). Remove the NetworkService.php Signed-off-by: Goh Jin Di --- lib/Search/SearchProvider.php | 1 + lib/Service/ApiService.php | 37 ++++++++---- lib/Service/NetworkService.php | 107 --------------------------------- 3 files changed, 25 insertions(+), 120 deletions(-) delete mode 100644 lib/Service/NetworkService.php diff --git a/lib/Search/SearchProvider.php b/lib/Search/SearchProvider.php index c7c5115..58fd050 100644 --- a/lib/Search/SearchProvider.php +++ b/lib/Search/SearchProvider.php @@ -1,4 +1,5 @@ client = $clientService->newClient(); $this->config = $configService->getConfig(); @@ -84,23 +85,33 @@ public function sendFile(int $fileId): void { } public function searchMessages(string $userId, string $term, int $offset = 0, int $limit = 10): array { - // Search API use Advanced Search, so asterik is needed behind and after query - $result = $this->request($userId, 'documents', [ + $arguments = [ 'format' => 'json', 'query' => '*' . $term . '*' , - ]); + ]; + + $paperlessURL = rtrim($this->config->url, '/') . '/api/documents/?' . http_build_query($arguments); + $result = $this->client->get($paperlessURL, + [ + 'headers' => array_merge( + $this->getAuthorizationHeaders(), + [ + 'Content-Type' => 'application/json', + 'Accept' => 'application/json' + ] + ) + ] + ); + + $body = $result->getBody(); + $json_body = json_decode($body, true); - if (isset($result['error'])) { - return (array)$result; + if (isset($json_body['error'])) { + return (array)$json_body; } // Sort by most recent - // $messages = array_reverse($result['document'] ?? []); - return array_slice($result, $offset, $limit); - } - - public function request(string $userId, string $endPoint, array $params = [], string $method = 'GET', - bool $jsonResponse = true, bool $paperlessApiRequest = true) { - return $this->networkService->request($userId, $endPoint, $params, $method, $jsonResponse, $paperlessApiRequest); + // $messages = array_reverse($json_body['document'] ?? []); + return array_slice($json_body, $offset, $limit); } } diff --git a/lib/Service/NetworkService.php b/lib/Service/NetworkService.php deleted file mode 100644 index 80e0518..0000000 --- a/lib/Service/NetworkService.php +++ /dev/null @@ -1,107 +0,0 @@ - - * @author Anupam Kumar - * @author Edward Ly - * @copyright Julien Veyssier 2022 - * @copyright Anupam Kumar 2023 - * @copyright Edward Ly 2024 - */ - -declare(strict_types=1); - -namespace OCA\Paperless\Service; - -use Exception; -use GuzzleHttp\Client; -use GuzzleHttp\Exception\ClientException; -use GuzzleHttp\Exception\ServerException; -use OCA\Paperless\AppInfo\Application; -use OCP\Http\Client\IClientService; -use OCP\IConfig; -use OCP\IL10N; -use Psr\Log\LoggerInterface; -use Throwable; - -/** - * Service to make network requests - */ -class NetworkService { - - private Client $client; - - public function __construct( - private IConfig $config, - IClientService $clientService, - private LoggerInterface $logger, - private ConfigService $configService, - private IL10N $l10n, - ) { - $this->client = new Client(); - } - - - public function request(string $userId, string $endPoint, array $params = [], string $method = 'GET', - bool $jsonResponse = true, bool $paperlessApiRequest = true) { - $paperlessUrl = $this->config->getUserValue($userId, Application::APP_ID, 'url'); - $apiKey = $this->config->getUserValue($userId, Application::APP_ID, 'token'); - - try { - $url = rtrim($paperlessUrl, '/') . '/api/' . $endPoint; - - $options = [ - 'headers' => [ - 'Authorization' => 'Token ' . $apiKey, - 'Content-Type' => 'application/json', - 'Accept' => 'application/json', - ], - ]; - - if (count($params) > 0) { - if ($method === 'GET') { - $url .= '/?' . http_build_query($params); - } else { - $options['json'] = $params; - } - } - - - if ($method === 'GET') { - $response = $this->client->get($url, $options); - } elseif ($method === 'POST') { - $response = $this->client->post($url, $options); - } elseif ($method === 'PUT') { - $response = $this->client->put($url, $options); - } elseif ($method === 'DELETE') { - $response = $this->client->delete($url, $options); - } else { - return ['error' => $this->l10n->t('Bad HTTP method')]; - } - - $body = $response->getBody()->getContents(); - $respCode = $response->getStatusCode(); - - if ($respCode >= 400) { - return ['error' => $this->l10n->t('Bad credentials')]; - } - - if ($jsonResponse) { - return json_decode($body, true); - } - return $body; - } catch (ServerException|ClientException $e) { - $body = $e->getResponse()->getBody(); - $this->logger->warning('Paperless API error : ' . $body, ['app' => Application::APP_ID]); - return ['error' => $e->getMessage()]; - } catch (Exception|Throwable $e) { - $this->logger->warning('Paperless API error', ['exception' => $e, 'app' => Application::APP_ID]); - return ['error' => $e->getMessage()]; - } - } -} From 49254f7ad03316f3bd016f300bfbd01a6e6951a5 Mon Sep 17 00:00:00 2001 From: Goh Jin Di Date: Tue, 17 Dec 2024 09:49:59 +0000 Subject: [PATCH 05/20] Remove thumbnail URL function. Signed-off-by: Goh Jin Di --- lib/Search/SearchProvider.php | 22 +- lib/Service/ApiService.php | 2 - on package-lock.json | 670 ---------------------------------- 3 files changed, 8 insertions(+), 686 deletions(-) delete mode 100644 on package-lock.json diff --git a/lib/Search/SearchProvider.php b/lib/Search/SearchProvider.php index 58fd050..71c1a48 100644 --- a/lib/Search/SearchProvider.php +++ b/lib/Search/SearchProvider.php @@ -66,7 +66,7 @@ public function getName(): string { } public function getOrder(string $route, array $routeParameters): int { - return 20; // Adjust priority as needed + return 30; // Adjust priority as needed } public function search(IUser $user, ISearchQuery $query): SearchResult { @@ -74,10 +74,11 @@ public function search(IUser $user, ISearchQuery $query): SearchResult { return SearchResult::complete($this->getName(), []); } + $offset = ($query->getCursor() ?? 0); $limit = $query->getLimit(); + $term = $query->getTerm(); - $offset = $query->getCursor(); - $offset = $offset ? intval($offset) : 0; + $this->logger->warning('Debug second offset :', ['offset' => $offset]); $url = $this->config->getUserValue($user->getUID(), Application::APP_ID, 'url'); $apiKey = $this->configService->getConfig($user->getUID(), 'token'); @@ -94,7 +95,7 @@ public function search(IUser $user, ISearchQuery $query): SearchResult { $dataEntries = $searchResult['results'] ?? []; $formattedResults = array_map(function (array $entry) use ($url): SearchResultEntry { - $finalThumbnailUrl = $this->getThumbnailUrl($entry); + $finalThumbnailUrl = ''; $title = $entry['title'] ?? 'Untitled'; $context = $entry['__search_hit__']['highlights'] ?? ''; $link = $this->getLinkToPaperless($entry, $url); @@ -103,7 +104,7 @@ public function search(IUser $user, ISearchQuery $query): SearchResult { $title, strip_tags($context), $link, - $finalThumbnailUrl === '' ? 'icon-paperless-search-fallback' : '', + $finalThumbnailUrl, true ); }, $dataEntries); @@ -111,7 +112,8 @@ public function search(IUser $user, ISearchQuery $query): SearchResult { return SearchResult::paginated( $this->getName(), $formattedResults, - $offset + count($dataEntries) + $offset + $limit + // $offset + count($dataEntries) ); } @@ -123,12 +125,4 @@ public function search(IUser $user, ISearchQuery $query): SearchResult { protected function getLinkToPaperless(array $entry, string $url): string { return rtrim($url, '/') . '/documents/' . ($entry['id'] ?? '#'); } - - /** - * @param array $entry - * @return string - */ - protected function getThumbnailUrl(array $entry): string { - return ''; - } } diff --git a/lib/Service/ApiService.php b/lib/Service/ApiService.php index 1022a72..763ce58 100644 --- a/lib/Service/ApiService.php +++ b/lib/Service/ApiService.php @@ -26,7 +26,6 @@ use OCP\Files\NotPermittedException; use OCP\Http\Client\IClient; use OCP\Http\Client\IClientService; -use Psr\Log\LoggerInterface; class ApiService { private IClient $client; @@ -38,7 +37,6 @@ public function __construct( private IRootFolder $root, ConfigService $configService, IClientService $clientService, - private LoggerInterface $logger, ) { $this->client = $clientService->newClient(); $this->config = $configService->getConfig(); diff --git a/on package-lock.json b/on package-lock.json deleted file mode 100644 index db83ac0..0000000 --- a/on package-lock.json +++ /dev/null @@ -1,670 +0,0 @@ -commit 834ee010cd841af1dc6c625e66db80e71153fe70 (HEAD -> feature/add-search-function-for-nextcloud, origin/feature/add-search-function-for-nextcloud) -Author: Goh Jin Di -Date: Tue Dec 17 03:16:32 2024 +0000 - - Fix indentation and apply coding standards, add the copyright of the original authors - -commit 6ad6b8918a95b0b3e9079454bbb7f21f8eef5b39 (remote) -Author: Ubuntu -Date: Fri Dec 13 06:16:27 2024 +0000 - - Adding search files functionality in Paperless from Nextcloud - - Signed-off-by: Goh Jin Di - -commit 79006f8bbe2f0099557094fda844868222c6592d (origin/main, origin/HEAD, main) -Merge: ccf7e61 c2cd1f7 -Author: Kate <26026535+provokateurin@users.noreply.github.com> -Date: Sun Dec 8 08:40:06 2024 +0100 - - Merge pull request #48 from nextcloud/automated/noid/main-fix-npm-audit - - [main] Fix npm audit - -commit c2cd1f74a61994efcf66d93cb5d9f332f4c5f48a -Author: nextcloud-command -Date: Sun Dec 8 03:34:43 2024 +0000 - - fix(deps): Fix npm audit - - Signed-off-by: GitHub - -commit ccf7e6198ca6594092338be905602e659b47ca00 -Merge: 059cb9b 9e85661 -Author: Kate <26026535+provokateurin@users.noreply.github.com> -Date: Sun Nov 24 17:07:11 2024 +0100 - - Merge pull request #45 from nextcloud/automated/noid/main-fix-npm-audit - -commit 9e85661e8e9b55504379e51e8e3cbae0878b06d2 -Author: nextcloud-command -Date: Sun Nov 24 03:21:40 2024 +0000 - - fix(deps): Fix npm audit - - Signed-off-by: GitHub - -commit 059cb9b29dbaf4f9ce81078ecefadb840fe82f41 -Merge: c31b33f 40686d3 -Author: Kate <26026535+provokateurin@users.noreply.github.com> -Date: Thu Nov 7 08:13:07 2024 +0100 - - Merge pull request #47 from nextcloud/dependabot/composer/vendor-bin/psalm/symfony/process-5.4.46 - -commit 40686d3595ced1cd253baae734aab4eaa56e7012 -Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> -Date: Wed Nov 6 20:37:02 2024 +0000 - - build(deps-dev): bump symfony/process in /vendor-bin/psalm - - Bumps [symfony/process](https://github.com/symfony/process) from 5.4.39 to 5.4.46. - - [Release notes](https://github.com/symfony/process/releases) - - [Changelog](https://github.com/symfony/process/blob/7.1/CHANGELOG.md) - - [Commits](https://github.com/symfony/process/compare/v5.4.39...v5.4.46) - - --- - updated-dependencies: - - dependency-name: symfony/process - dependency-type: indirect - ... - - Signed-off-by: dependabot[bot] - -commit c31b33f0fe5ce00f4ba1d09ef5f443aa3e361dd0 -Merge: f800174 67eb457 -Author: Kate <26026535+provokateurin@users.noreply.github.com> -Date: Thu Oct 31 06:50:00 2024 +0100 - - Merge pull request #46 from nextcloud/dependabot/npm_and_yarn/elliptic-6.6.0 - -commit 67eb4572fe34400d1bd88e1c83d9c757e3c92287 -Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> -Date: Thu Oct 31 02:12:34 2024 +0000 - - build(deps): bump elliptic from 6.5.7 to 6.6.0 - - Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.7 to 6.6.0. - - [Commits](https://github.com/indutny/elliptic/compare/v6.5.7...v6.6.0) - - --- - updated-dependencies: - - dependency-name: elliptic - dependency-type: indirect - ... - - Signed-off-by: dependabot[bot] - -commit f800174dca5785934163845d77194e9150e315af -Merge: 1ce64fe c1e7b94 -Author: Kate <26026535+provokateurin@users.noreply.github.com> -Date: Sun Oct 13 08:41:33 2024 +0200 - - Merge pull request #43 from nextcloud/automated/noid/main-fix-npm-audit - -commit c1e7b94dcc6b95319837989410106e85e6c6ef7b -Author: nextcloud-command -Date: Sun Oct 13 03:25:33 2024 +0000 - - fix(deps): Fix npm audit - - Signed-off-by: GitHub - -commit 1ce64fe020418bbe101191e0b4cc7d011da29bfd -Merge: bead86d 4df02d8 -Author: Kate <26026535+provokateurin@users.noreply.github.com> -Date: Sun Sep 29 08:56:31 2024 +0200 - - Merge pull request #42 from nextcloud/automated/noid/main-fix-npm-audit - -commit 4df02d837fdddeb1909e06ec86349f6b9c1a46dd -Author: nextcloud-command -Date: Sun Sep 29 03:27:43 2024 +0000 - - fix(deps): Fix npm audit - - Signed-off-by: GitHub - -commit bead86dfc5a7267a6405c4cbb5d9b44c379261ec -Merge: 756a3e7 75f89f6 -Author: Kate <26026535+provokateurin@users.noreply.github.com> -Date: Sun Sep 22 08:23:23 2024 +0200 - - Merge pull request #41 from nextcloud/automated/noid/main-fix-npm-audit - -commit 75f89f64bfaf36aa6ee7bde33bbeb71a540c8827 -Author: nextcloud-command -Date: Sun Sep 22 03:24:41 2024 +0000 - - fix(deps): Fix npm audit - - Signed-off-by: GitHub - -commit 756a3e79bdf4601fe9d1f3cc27026e2dcbccf271 -Merge: c1ec8cd cac5bcd -Author: Kate <26026535+provokateurin@users.noreply.github.com> -Date: Wed Sep 18 10:14:40 2024 +0200 - - Merge pull request #39 from nextcloud/chore/release/v1.0.4 - -commit cac5bcd90d7d29908cdc4d05522e5815c6be06fc -Author: provokateurin -Date: Wed Sep 18 10:10:24 2024 +0200 - - chore(release): v1.0.4 - - Signed-off-by: provokateurin - -commit c3b7dca9c98d060a706e3ba10e890c02d9fa2345 -Author: provokateurin -Date: Wed Sep 18 10:09:56 2024 +0200 - - build: Add Nextcloud 30 support - - Signed-off-by: provokateurin - -commit c1ec8cd97af8ecc85ebfc8b64c6fad1b5f2b3e98 -Merge: a08f36b 7d143f5 -Author: Kate <26026535+provokateurin@users.noreply.github.com> -Date: Sun Sep 15 07:22:45 2024 +0200 - - Merge pull request #38 from nextcloud/automated/noid/main-fix-npm-audit - -commit 7d143f51ed01b83ae76e30a4a061906a963905b6 -Author: nextcloud-command -Date: Sun Sep 15 03:18:30 2024 +0000 - - fix(deps): Fix npm audit - - Signed-off-by: GitHub - -commit a08f36b499893c89d7e94699fe1428c6f7fc1f2c -Merge: 9cba303 7c8fb51 -Author: Kate <26026535+provokateurin@users.noreply.github.com> -Date: Sat Aug 31 08:21:25 2024 +0200 - - Merge pull request #35 from nextcloud/dependabot/npm_and_yarn/webpack-5.94.0 - -commit 7c8fb5149dee79194add4357c676eaca3cbcd053 -Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> -Date: Sat Aug 31 02:42:17 2024 +0000 - - build(deps): bump webpack from 5.90.3 to 5.94.0 - - Bumps [webpack](https://github.com/webpack/webpack) from 5.90.3 to 5.94.0. - - [Release notes](https://github.com/webpack/webpack/releases) - - [Commits](https://github.com/webpack/webpack/compare/v5.90.3...v5.94.0) - - --- - updated-dependencies: - - dependency-name: webpack - dependency-type: indirect - ... - - Signed-off-by: dependabot[bot] - -commit 9cba3035a0dad55aa888e89a4f453642c33c5697 -Merge: 1f0e6e6 04a31ea -Author: Kate <26026535+provokateurin@users.noreply.github.com> -Date: Sun Aug 25 13:36:05 2024 +0200 - - Merge pull request #33 from nextcloud/automated/noid/main-fix-npm-audit - -commit 04a31eafd1179504d91528c5f891c6f5b475122b -Author: nextcloud-command -Date: Sun Aug 25 03:00:10 2024 +0000 - - fix(deps): Fix npm audit - - Signed-off-by: GitHub - -commit 1f0e6e689f60625b591caed8ce387bf83505b630 -Merge: 6860e86 27b855e -Author: Kate <26026535+provokateurin@users.noreply.github.com> -Date: Fri Aug 23 14:38:33 2024 +0200 - - Merge pull request #32 from nextcloud/automated/update-workflows/default - -commit 27b855eeb8e4accf9388875113bfcd21c4281271 -Author: skjnldsv -Date: Thu Aug 22 22:22:40 2024 +0200 - - chore: update workflows from templates - - Signed-off-by: skjnldsv - -commit 6860e86332f5164c786640dcd988cdedfee3cc9f -Merge: 12fed51 8c7194f -Author: Kate <26026535+provokateurin@users.noreply.github.com> -Date: Sun Aug 18 06:58:52 2024 +0200 - - Merge pull request #31 from nextcloud/automated/noid/main-fix-npm-audit - -commit 8c7194f9841dee53d0fda7ad94600003c0b7d194 -Author: nextcloud-command -Date: Sun Aug 18 03:01:10 2024 +0000 - - fix(deps): Fix npm audit - - Signed-off-by: GitHub - -commit 12fed512ec632e4bc0b0f8075ab4bff89b9e6a08 -Merge: d7dc93c 37b88e0 -Author: Kate <26026535+provokateurin@users.noreply.github.com> -Date: Sun Aug 11 18:11:02 2024 +0200 - - Merge pull request #30 from nextcloud/automated/noid/main-fix-npm-audit - -commit 37b88e071609696d0a14c4fe4d8f59d7af60934b -Author: nextcloud-command -Date: Sun Aug 11 03:06:56 2024 +0000 - - fix(deps): Fix npm audit - - Signed-off-by: GitHub - -commit d7dc93c0f3562ee9feab6c8e8db827cec28fabdf -Merge: 9a5e202 92d2796 -Author: Kate <26026535+provokateurin@users.noreply.github.com> -Date: Tue Jul 30 08:46:58 2024 +0200 - - Merge pull request #29 from nextcloud/dependabot/npm_and_yarn/fast-xml-parser-4.4.1 - -commit 92d2796ec9be85f7340ef21217b2e6c78e44ab1c -Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> -Date: Mon Jul 29 22:12:46 2024 +0000 - - build(deps): bump fast-xml-parser from 4.3.4 to 4.4.1 - - Bumps [fast-xml-parser](https://github.com/NaturalIntelligence/fast-xml-parser) from 4.3.4 to 4.4.1. - - [Release notes](https://github.com/NaturalIntelligence/fast-xml-parser/releases) - - [Changelog](https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/CHANGELOG.md) - - [Commits](https://github.com/NaturalIntelligence/fast-xml-parser/compare/v4.3.4...v4.4.1) - - --- - updated-dependencies: - - dependency-name: fast-xml-parser - dependency-type: indirect - ... - - Signed-off-by: dependabot[bot] - -commit 9a5e202ff9c34b75ad3eafcde01f24252bf31a9c -Merge: f6eb62c a2718a8 -Author: Andy Scherzinger -Date: Sat Jul 13 14:27:13 2024 +0200 - - Merge pull request #26 from nextcloud/automated/update-workflows/default - - chore: update workflows from templates - -commit a2718a81b2ed004c48aa923778c77fe50561f0b7 -Author: skjnldsv -Date: Sat Jul 13 10:41:23 2024 +0200 - - chore: update workflows from templates - - Signed-off-by: skjnldsv - -commit f6eb62cf82f2795f77454816e32316bf4dc38267 -Merge: 0b4ac80 bb33527 -Author: Kate <26026535+provokateurin@users.noreply.github.com> -Date: Wed Jun 19 06:53:33 2024 +0200 - - Merge pull request #24 from nextcloud/dependabot/npm_and_yarn/ws-8.17.1 - -commit bb33527f39401161065cdbb8219ecccd18f706d7 -Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> -Date: Tue Jun 18 22:56:09 2024 +0000 - - build(deps-dev): bump ws from 8.16.0 to 8.17.1 - - Bumps [ws](https://github.com/websockets/ws) from 8.16.0 to 8.17.1. - - [Release notes](https://github.com/websockets/ws/releases) - - [Commits](https://github.com/websockets/ws/compare/8.16.0...8.17.1) - - --- - updated-dependencies: - - dependency-name: ws - dependency-type: indirect - ... - - Signed-off-by: dependabot[bot] - -commit 0b4ac806bcabec3f0bcfd4e5ce9ec664139bed5f -Merge: 70cfd72 f16329f -Author: Kate <26026535+provokateurin@users.noreply.github.com> -Date: Sun Jun 16 08:29:13 2024 +0200 - - Merge pull request #23 from nextcloud/automated/noid/main-fix-npm-audit - -commit f16329f2917a9a637849fef1e3e8b68464b657da -Author: nextcloud-command -Date: Sun Jun 16 03:11:47 2024 +0000 - - fix(deps): fix npm audit - - Signed-off-by: GitHub - -commit 70cfd72d7ba66688959f64f380e01bb8d47eddc8 -Author: provokateurin -Date: Fri May 10 07:03:22 2024 +0200 - - chore(release): v1.0.3 - - Signed-off-by: provokateurin - -commit 24f692071327d3c00ff0167f053b01f92d32812c -Merge: f1530a8 1bc8fb1 -Author: Kate <26026535+provokateurin@users.noreply.github.com> -Date: Fri May 10 07:02:23 2024 +0200 - - Merge pull request #21 from nextcloud/fix/minimum-28 - -commit 1bc8fb1d15b232287df3ff2e8f752e815cba63b0 -Author: provokateurin -Date: Fri May 10 06:52:09 2024 +0200 - - fix: Set minimum Nextcloud version to 28 due to incompatibilities - - Signed-off-by: provokateurin - -commit f1530a832c49073c5be8a55c89195ec95a5b364f -Author: provokateurin -Date: Fri May 3 08:07:47 2024 +0200 - - chore(release): v1.0.2 - - Signed-off-by: provokateurin - -commit 155817ec3aaf267269b342469fab8e163a8b71de -Merge: ac0afb5 362da64 -Author: Kate <26026535+provokateurin@users.noreply.github.com> -Date: Fri May 3 08:06:03 2024 +0200 - - Merge pull request #19 from nextcloud/feat/appinfo/screenshot - -commit 362da64406e205d5b1ceb82f12c50bb57ba334c1 -Author: provokateurin -Date: Fri May 3 08:03:25 2024 +0200 - - feat(appinfo): Add screenshot for Appstore - - Signed-off-by: provokateurin - -commit 7354afeafe4e5252d02992059460099877d29f0f -Author: provokateurin -Date: Fri May 3 08:01:40 2024 +0200 - - fix(changelog): Format according to keep a changelog convention - - Signed-off-by: provokateurin - -commit ac0afb5be5c29256a3a77e62d963b52adf4e48a9 -Merge: 02aeba4 370991f -Author: Kate <26026535+provokateurin@users.noreply.github.com> -Date: Tue Apr 23 14:39:01 2024 +0200 - - Merge pull request #13 from nextcloud/dependabot/npm_and_yarn/follow-redirects-1.15.6 - -commit 02aeba490f5caa0a93fc7c84ad6e3a279e39c5a2 -Merge: 42b2a13 424e9e0 -Author: Kate <26026535+provokateurin@users.noreply.github.com> -Date: Tue Apr 23 14:38:52 2024 +0200 - - Merge pull request #15 from nextcloud/dependabot/npm_and_yarn/webpack-dev-middleware-5.3.4 - -commit 42b2a133966632efcaeed8618d55827d281f87e9 -Merge: eeee175 b87fd5d -Author: Kate <26026535+provokateurin@users.noreply.github.com> -Date: Tue Apr 23 14:38:43 2024 +0200 - - Merge pull request #16 from nextcloud/dependabot/npm_and_yarn/express-4.19.2 - -commit eeee175a0b6745c3101b0223c3942590eb2df4f7 -Merge: 8a17e0a 9d7de09 -Author: Kate <26026535+provokateurin@users.noreply.github.com> -Date: Tue Apr 23 14:38:29 2024 +0200 - - Merge pull request #14 from nextcloud/automated/noid/main-fix-npm-audit - -commit 9d7de093aa56291abe093277a7efb0a2c05c0e74 -Author: nextcloud-command -Date: Sun Apr 14 04:26:32 2024 +0000 - - fix(deps): fix npm audit - - Signed-off-by: GitHub - -commit b87fd5d118efb50fdd991cc3d98791a6e36a3acc -Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> -Date: Fri Mar 29 18:13:52 2024 +0000 - - build(deps-dev): bump express from 4.18.2 to 4.19.2 - - Bumps [express](https://github.com/expressjs/express) from 4.18.2 to 4.19.2. - - [Release notes](https://github.com/expressjs/express/releases) - - [Changelog](https://github.com/expressjs/express/blob/master/History.md) - - [Commits](https://github.com/expressjs/express/compare/4.18.2...4.19.2) - - --- - updated-dependencies: - - dependency-name: express - dependency-type: indirect - ... - - Signed-off-by: dependabot[bot] - -commit 424e9e06eb8c64149194fbb8971e6c9784e3bf60 -Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> -Date: Sun Mar 24 00:50:41 2024 +0000 - - build(deps-dev): bump webpack-dev-middleware from 5.3.3 to 5.3.4 - - Bumps [webpack-dev-middleware](https://github.com/webpack/webpack-dev-middleware) from 5.3.3 to 5.3.4. - - [Release notes](https://github.com/webpack/webpack-dev-middleware/releases) - - [Changelog](https://github.com/webpack/webpack-dev-middleware/blob/v5.3.4/CHANGELOG.md) - - [Commits](https://github.com/webpack/webpack-dev-middleware/compare/v5.3.3...v5.3.4) - - --- - updated-dependencies: - - dependency-name: webpack-dev-middleware - dependency-type: indirect - ... - - Signed-off-by: dependabot[bot] - -commit 370991fa8135b86238e2d4336203ad060f2f7a2f -Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> -Date: Sun Mar 17 00:33:44 2024 +0000 - - build(deps): bump follow-redirects from 1.15.5 to 1.15.6 - - Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.5 to 1.15.6. - - [Release notes](https://github.com/follow-redirects/follow-redirects/releases) - - [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.15.5...v1.15.6) - - --- - updated-dependencies: - - dependency-name: follow-redirects - dependency-type: indirect - ... - - Signed-off-by: dependabot[bot] - -commit 8a17e0a804e3bd0bd7350864756dd6820d7d1d10 -Merge: 889d1e4 73c1cca -Author: Kate <26026535+provokateurin@users.noreply.github.com> -Date: Fri Mar 15 09:46:52 2024 +0100 - - Merge pull request #9 from nextcloud/chore/release/1.0.1 - -commit 73c1ccae7c94ed245ca84580f44cf4dc0ecad0fd -Author: provokateurin -Date: Fri Mar 15 09:44:08 2024 +0100 - - chore(release): v1.0.1 - - Signed-off-by: provokateurin - -commit 889d1e41ccfe9cab45b88b3c413bc696a2077630 -Merge: 70d30e4 6cd3dcc -Author: Kate <26026535+provokateurin@users.noreply.github.com> -Date: Fri Mar 15 09:39:44 2024 +0100 - - Merge pull request #8 from nextcloud/chore/docs/update-app-description - -commit 6cd3dccde2511b4042c021d7f14bef5f047abcac -Author: provokateurin -Date: Fri Mar 15 09:37:02 2024 +0100 - - chore(docs): Update app description - - Signed-off-by: provokateurin - -commit 70d30e486cc4d8243f5aad725014bc2adbe512fd -Merge: db6f38f 4b2f31c -Author: Kate <26026535+provokateurin@users.noreply.github.com> -Date: Fri Mar 15 09:34:04 2024 +0100 - - Merge pull request #7 from nextcloud/build/krankerl-config - -commit db6f38f941376d69ae7fdd997f85b38db07254d8 -Merge: bc03c95 b7d240e -Author: Kate <26026535+provokateurin@users.noreply.github.com> -Date: Fri Mar 15 09:29:49 2024 +0100 - - Merge pull request #6 from nextcloud/chore/remove-makefile - -commit 4b2f31c42291dba0c16cb7f5c70976dbb26c1991 -Author: provokateurin -Date: Fri Mar 15 09:29:29 2024 +0100 - - build: Add krankerl config - - Signed-off-by: provokateurin - -commit b7d240e2fa4d34b9c4b9e8bfe24194e0a14dd80e -Author: provokateurin -Date: Fri Mar 15 09:27:04 2024 +0100 - - chore: Remove Makefile - - Signed-off-by: provokateurin - -commit bc03c95f60ffe3b2f220ad6c3e62068376fa833f -Merge: 93e7a76 171604a -Author: Kate <26026535+provokateurin@users.noreply.github.com> -Date: Mon Mar 11 15:59:23 2024 +0100 - - Merge pull request #4 from nextcloud/automated/update-workflows/default - -commit 171604a0b172d8cc73cf9c41040a826cb04ab536 -Author: skjnldsv -Date: Fri Mar 8 20:57:12 2024 +0100 - - chore: update workflows from templates - - Signed-off-by: skjnldsv - -commit 93e7a7689d5c5fda216663c2a81f8e8a29dc0396 -Author: provokateurin -Date: Mon Mar 11 15:56:30 2024 +0100 - - ci: Run psalm against stable28 - - Signed-off-by: provokateurin - -commit 91c8d0552a792eaa1593eb5f85ed5d9220b0038f -Author: provokateurin -Date: Mon Mar 11 15:48:30 2024 +0100 - - fix(composer): Force PHP 8.0 compatibility - - Signed-off-by: provokateurin - -commit 332b872f67580c1bb04c2fc31513085706a743ea -Author: provokateurin -Date: Mon Mar 11 15:00:04 2024 +0100 - - fix: Run psalm single threaded - - Signed-off-by: provokateurin - -commit 11aa22edf85b8d6fedaa0f3ffcc6ba2a255ac1c7 -Author: provokateurin -Date: Mon Mar 11 14:55:35 2024 +0100 - - chore: Correctly format composer.json - - Signed-off-by: provokateurin - -commit 13b1b3f7b944744a824bcb3b5c358a516cd40aca -Merge: 597ee5b b06d561 -Author: Kate <26026535+provokateurin@users.noreply.github.com> -Date: Mon Mar 11 14:44:53 2024 +0100 - - Merge pull request #5 from nextcloud/fix/composer-bin - -commit b06d561a2367ab27ebf6c6356fe2318a3da706bd -Author: provokateurin -Date: Mon Mar 11 14:42:30 2024 +0100 - - fix: Install composer bin plugin on non-dev environments - - Signed-off-by: provokateurin - -commit 597ee5b53230d0ca264af9ec1cee71becdd96a0b -Author: MB-Finski -Date: Fri Mar 1 10:05:41 2024 +0000 - - Add app description - - Signed-off-by: MB-Finski - -commit 73be729470f62ef6cde494a9c459aacb100e6408 -Author: MB-Finski -Date: Tue Feb 27 08:45:27 2024 +0000 - - Add bin script for non-dev environments - - Signed-off-by: MB-Finski - -commit 9cbb3e30c93496373f34de4224d102cfd58cac0b -Author: MB-Finski -Date: Mon Feb 26 12:22:20 2024 +0000 - - Add makefile - - Signed-off-by: MB-Finski - -commit 12ea44bf78d8d6c929dc20a384759a3d4cd4444f -Author: MB-Finski -Date: Mon Feb 26 12:11:29 2024 +0000 - - Add appstore publish workflow - - Signed-off-by: MB-Finski - -commit 21bfdbf32751382550dd2e3ed3e9a4caa9171d20 -Author: provokateurin -Date: Tue Feb 20 13:52:12 2024 +0100 - - chore: fix composer.json - - Signed-off-by: provokateurin - -commit 799b033f7742114701db6042ecb4abd9507eca81 -Author: provokateurin -Date: Tue Feb 20 13:39:29 2024 +0100 - - fix: Configure composer bin plugin correctly - - Signed-off-by: provokateurin - -commit 34923410bfa1f6fa7812db2051e2f027a68be210 -Author: provokateurin -Date: Tue Feb 20 11:55:51 2024 +0100 - - Initial commit - - Signed-off-by: provokateurin From feb3dc70d4c01aef00119bcfe4bf66932d41db2e Mon Sep 17 00:00:00 2001 From: Goh Jin Di Date: Wed, 18 Dec 2024 09:07:49 +0000 Subject: [PATCH 06/20] Fix pagination feature Signed-off-by: Goh Jin Di --- lib/Search/SearchProvider.php | 158 +++++++++++++++++----------------- 1 file changed, 77 insertions(+), 81 deletions(-) diff --git a/lib/Search/SearchProvider.php b/lib/Search/SearchProvider.php index 71c1a48..caab2d9 100644 --- a/lib/Search/SearchProvider.php +++ b/lib/Search/SearchProvider.php @@ -44,85 +44,81 @@ class SearchProvider implements IProvider { - public function __construct( - private LoggerInterface $logger, - private IAppManager $appManager, - private IL10N $l10n, - private IConfig $config, - private IURLGenerator $urlGenerator, - private IDateTimeFormatter $dateTimeFormatter, - private IDateTimeZone $dateTimeZone, - private ConfigService $configService, - private ApiService $apiService, - ) { - } - - public function getId(): string { - return 'paperless-search-messages'; - } - - public function getName(): string { - return $this->l10n->t('Paperless Search Result'); - } - - public function getOrder(string $route, array $routeParameters): int { - return 30; // Adjust priority as needed - } - - public function search(IUser $user, ISearchQuery $query): SearchResult { - if (!$this->appManager->isEnabledForUser(Application::APP_ID, $user)) { - return SearchResult::complete($this->getName(), []); - } - - $offset = ($query->getCursor() ?? 0); - $limit = $query->getLimit(); - - $term = $query->getTerm(); - $this->logger->warning('Debug second offset :', ['offset' => $offset]); - - $url = $this->config->getUserValue($user->getUID(), Application::APP_ID, 'url'); - $apiKey = $this->configService->getConfig($user->getUID(), 'token'); - - if ($url === '' || $apiKey === '') { - return SearchResult::paginated($this->getName(), [], 0); - } - - // Call Paperless API - $searchResult = $this->apiService->searchMessages($user->getUID(), $term, $offset, $limit); - if (isset($searchResult['error'])) { - return SearchResult::paginated($this->getName(), [], 0); - } - - $dataEntries = $searchResult['results'] ?? []; - $formattedResults = array_map(function (array $entry) use ($url): SearchResultEntry { - $finalThumbnailUrl = ''; - $title = $entry['title'] ?? 'Untitled'; - $context = $entry['__search_hit__']['highlights'] ?? ''; - $link = $this->getLinkToPaperless($entry, $url); - return new SearchResultEntry( - $finalThumbnailUrl, - $title, - strip_tags($context), - $link, - $finalThumbnailUrl, - true - ); - }, $dataEntries); - - return SearchResult::paginated( - $this->getName(), - $formattedResults, - $offset + $limit - // $offset + count($dataEntries) - ); - } - - /** - * @param array $entry - * @param string $url - * @return string - */ - protected function getLinkToPaperless(array $entry, string $url): string { - return rtrim($url, '/') . '/documents/' . ($entry['id'] ?? '#'); - } + public function __construct( + private LoggerInterface $logger, + private IAppManager $appManager, + private IL10N $l10n, + private IConfig $config, + private IURLGenerator $urlGenerator, + private IDateTimeFormatter $dateTimeFormatter, + private IDateTimeZone $dateTimeZone, + private ConfigService $configService, + private ApiService $apiService, + ) { + } + + public function getId(): string { + return 'paperless-search-messages'; + } + + public function getName(): string { + return $this->l10n->t('Paperless Search Result'); + } + + public function getOrder(string $route, array $routeParameters): int { + return 30; // Adjust priority as needed + } + + public function search(IUser $user, ISearchQuery $query, $page = 1, $resultsPerPage = 5): SearchResult { + $offset = ($query->getCursor() ?? 0); + $limit = $query->getLimit(); + + $term = $query->getTerm(); + + $url = $this->config->getUserValue($user->getUID(), Application::APP_ID, 'url'); + $apiKey = $this->configService->getConfig($user->getUID(), 'token'); + + if ($url === '' || $apiKey === '') { + return SearchResult::paginated($this->getName(), [], 0); + } + + $searchResult = $this->apiService->searchMessages($user->getUID(), $term); + + if (isset($searchResult['error'])) { + return SearchResult::paginated($this->getName(), [], 0); + } + + // Paginate the results manually since the API does not provide offset/limit + $pagedResults = array_slice($searchResult['results'], $offset, $limit); + + $formattedResults = array_map(function (array $entry) use ($url): SearchResultEntry { + $finalThumbnailUrl = ''; + $title = $entry['title'] ?? 'Untitled'; + $context = $entry['__search_hit__']['highlights'] ?? ''; + $link = $this->getLinkToPaperless($entry, $url); + return new SearchResultEntry( + $finalThumbnailUrl, + $title, + strip_tags($context), + $link, + $finalThumbnailUrl, + true + ); + }, $pagedResults); + + return SearchResult::paginated( + $this->getName(), + $formattedResults, + $offset + $limit + ); + } + + /** + * @param array $entry + * @param string $url + * @return string + */ + protected function getLinkToPaperless(array $entry, string $url): string { + return rtrim($url, '/') . '/documents/' . ($entry['id'] ?? '#'); + } } From 72bea301275bcaebd55cc25bd2056fbc7ded8a47 Mon Sep 17 00:00:00 2001 From: Goh Jin Di Date: Wed, 18 Dec 2024 09:14:25 +0000 Subject: [PATCH 07/20] Move strip_tag to initialization Signed-off-by: Goh Jin Di --- lib/Search/SearchProvider.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Search/SearchProvider.php b/lib/Search/SearchProvider.php index caab2d9..b9b0014 100644 --- a/lib/Search/SearchProvider.php +++ b/lib/Search/SearchProvider.php @@ -94,12 +94,12 @@ public function search(IUser $user, ISearchQuery $query, $page = 1, $resultsPerP $formattedResults = array_map(function (array $entry) use ($url): SearchResultEntry { $finalThumbnailUrl = ''; $title = $entry['title'] ?? 'Untitled'; - $context = $entry['__search_hit__']['highlights'] ?? ''; + $context = strip_tags($entry['__search_hit__']['highlights'] ?? ''); $link = $this->getLinkToPaperless($entry, $url); return new SearchResultEntry( $finalThumbnailUrl, $title, - strip_tags($context), + $context, $link, $finalThumbnailUrl, true From f6b0bd111b957dd300cd85633a3b08e88ef48e74 Mon Sep 17 00:00:00 2001 From: Jin-Di Date: Thu, 19 Dec 2024 10:29:09 +0800 Subject: [PATCH 08/20] Update lib/Service/ApiService.php Co-authored-by: Kate <26026535+provokateurin@users.noreply.github.com> Signed-off-by: Jin-Di --- lib/Service/ApiService.php | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/Service/ApiService.php b/lib/Service/ApiService.php index 763ce58..31a23c7 100644 --- a/lib/Service/ApiService.php +++ b/lib/Service/ApiService.php @@ -94,7 +94,6 @@ public function searchMessages(string $userId, string $term, int $offset = 0, in 'headers' => array_merge( $this->getAuthorizationHeaders(), [ - 'Content-Type' => 'application/json', 'Accept' => 'application/json' ] ) From e392558029468db54a6160673ab8e741b82eadbf Mon Sep 17 00:00:00 2001 From: Jin-Di Date: Thu, 19 Dec 2024 10:42:57 +0800 Subject: [PATCH 09/20] Update lib/Service/ApiService.php Co-authored-by: Kate <26026535+provokateurin@users.noreply.github.com> Signed-off-by: Jin-Di --- lib/Service/ApiService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Service/ApiService.php b/lib/Service/ApiService.php index 31a23c7..40e3e1a 100644 --- a/lib/Service/ApiService.php +++ b/lib/Service/ApiService.php @@ -101,7 +101,7 @@ public function searchMessages(string $userId, string $term, int $offset = 0, in ); $body = $result->getBody(); - $json_body = json_decode($body, true); + $json_body = json_decode($body, true, 512, JSON_THROW_ON_ERROR); if (isset($json_body['error'])) { return (array)$json_body; From 96dd592373794f4d0007a503f173c95e956616e9 Mon Sep 17 00:00:00 2001 From: Goh Jin Di Date: Thu, 19 Dec 2024 02:46:18 +0000 Subject: [PATCH 10/20] Remove controller and change the limit Signed-off-by: Goh Jin Di --- lib/Controller/SearchController.php | 45 ----------------------------- lib/Service/ApiService.php | 6 ++-- 2 files changed, 3 insertions(+), 48 deletions(-) delete mode 100644 lib/Controller/SearchController.php diff --git a/lib/Controller/SearchController.php b/lib/Controller/SearchController.php deleted file mode 100644 index 9d56740..0000000 --- a/lib/Controller/SearchController.php +++ /dev/null @@ -1,45 +0,0 @@ -apiService->search($this->userId, $query, $limit, $offset); - - if (isset($results['error'])) { - return new DataResponse(['error' => $results['error']], Http::STATUS_BAD_REQUEST); - } - - return new DataResponse($results); - } -} diff --git a/lib/Service/ApiService.php b/lib/Service/ApiService.php index 763ce58..79f55c7 100644 --- a/lib/Service/ApiService.php +++ b/lib/Service/ApiService.php @@ -82,7 +82,7 @@ public function sendFile(int $fileId): void { ); } - public function searchMessages(string $userId, string $term, int $offset = 0, int $limit = 10): array { + public function searchMessages(string $userId, string $term, int $offset = 0, int $limit = 5): array { $arguments = [ 'format' => 'json', 'query' => '*' . $term . '*' , @@ -109,7 +109,7 @@ public function searchMessages(string $userId, string $term, int $offset = 0, in } // Sort by most recent - // $messages = array_reverse($json_body['document'] ?? []); - return array_slice($json_body, $offset, $limit); + $messages = array_reverse($json_body ?? []); + return array_slice($messages, $offset, $limit); } } From 2e576db709df2daa0085211c0fe9b15814bcb421 Mon Sep 17 00:00:00 2001 From: Goh Jin Di Date: Thu, 19 Dec 2024 03:53:16 +0000 Subject: [PATCH 11/20] Fix error handling Signed-off-by: Goh Jin Di --- lib/Search/SearchProvider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Search/SearchProvider.php b/lib/Search/SearchProvider.php index b9b0014..9f5c30e 100644 --- a/lib/Search/SearchProvider.php +++ b/lib/Search/SearchProvider.php @@ -84,7 +84,7 @@ public function search(IUser $user, ISearchQuery $query, $page = 1, $resultsPerP $searchResult = $this->apiService->searchMessages($user->getUID(), $term); - if (isset($searchResult['error'])) { + if (isset($searchResult['html'])) { return SearchResult::paginated($this->getName(), [], 0); } From a636dfe99bec928ce084c4503fa0fcc475ab175d Mon Sep 17 00:00:00 2001 From: Goh Jin Di Date: Thu, 19 Dec 2024 03:59:29 +0000 Subject: [PATCH 12/20] Update ApiService.php Signed-off-by: Goh Jin Di --- lib/Service/ApiService.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/lib/Service/ApiService.php b/lib/Service/ApiService.php index 6f06818..6b09948 100644 --- a/lib/Service/ApiService.php +++ b/lib/Service/ApiService.php @@ -26,6 +26,7 @@ use OCP\Files\NotPermittedException; use OCP\Http\Client\IClient; use OCP\Http\Client\IClientService; +use Psr\Log\LoggerInterface; class ApiService { private IClient $client; @@ -37,6 +38,7 @@ public function __construct( private IRootFolder $root, ConfigService $configService, IClientService $clientService, + private LoggerInterface $logger, ) { $this->client = $clientService->newClient(); $this->config = $configService->getConfig(); @@ -103,12 +105,6 @@ public function searchMessages(string $userId, string $term, int $offset = 0, in $body = $result->getBody(); $json_body = json_decode($body, true, 512, JSON_THROW_ON_ERROR); - if (isset($json_body['error'])) { - return (array)$json_body; - } - - // Sort by most recent - $messages = array_reverse($json_body ?? []); - return array_slice($messages, $offset, $limit); + return array_slice($json_body, $offset, $limit); } } From 6f597e6b96a6e7f7f689538a98d9e389dc76be4b Mon Sep 17 00:00:00 2001 From: Jin-Di Date: Thu, 19 Dec 2024 12:03:38 +0800 Subject: [PATCH 13/20] Update lib/Search/SearchProvider.php Co-authored-by: Kate <26026535+provokateurin@users.noreply.github.com> Signed-off-by: Jin-Di --- lib/Search/SearchProvider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Search/SearchProvider.php b/lib/Search/SearchProvider.php index 9f5c30e..59440c8 100644 --- a/lib/Search/SearchProvider.php +++ b/lib/Search/SearchProvider.php @@ -58,7 +58,7 @@ public function __construct( } public function getId(): string { - return 'paperless-search-messages'; + return 'paperless-search-documents'; } public function getName(): string { From 559302bbd19ee2343ae64759e91e9df52fb49986 Mon Sep 17 00:00:00 2001 From: Jin-Di Date: Thu, 19 Dec 2024 14:07:08 +0800 Subject: [PATCH 14/20] Update lib/Search/SearchProvider.php Co-authored-by: Kate <26026535+provokateurin@users.noreply.github.com> Signed-off-by: Jin-Di --- lib/Search/SearchProvider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Search/SearchProvider.php b/lib/Search/SearchProvider.php index 59440c8..be6a204 100644 --- a/lib/Search/SearchProvider.php +++ b/lib/Search/SearchProvider.php @@ -62,7 +62,7 @@ public function getId(): string { } public function getName(): string { - return $this->l10n->t('Paperless Search Result'); + return $this->l10n->t('Paperless document search result'); } public function getOrder(string $route, array $routeParameters): int { From f22e30ff791db393d30648b07f99272f170d1499 Mon Sep 17 00:00:00 2001 From: Goh Jin Di Date: Thu, 19 Dec 2024 06:08:57 +0000 Subject: [PATCH 15/20] Signed-off-by: Goh Jin Di Modify author list --- lib/Search/SearchProvider.php | 2 +- lib/Service/ApiService.php | 14 -------------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/lib/Search/SearchProvider.php b/lib/Search/SearchProvider.php index 9f5c30e..2fbe9a1 100644 --- a/lib/Search/SearchProvider.php +++ b/lib/Search/SearchProvider.php @@ -5,7 +5,7 @@ * @copyright Copyright (c) 2024, Edward Ly * * @author Edward Ly - * + * @author Goh Jin Di * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify diff --git a/lib/Service/ApiService.php b/lib/Service/ApiService.php index 6b09948..b879b5a 100644 --- a/lib/Service/ApiService.php +++ b/lib/Service/ApiService.php @@ -1,19 +1,5 @@ - * @author Anupam Kumar - * @author Edward Ly - * @copyright Julien Veyssier 2022 - * @copyright Anupam Kumar 2023 - * @copyright Edward Ly 2024 - */ - declare(strict_types=1); namespace OCA\Paperless\Service; From 78fcaa2e2f7bccb7aaf2b05d598b803d7d058b14 Mon Sep 17 00:00:00 2001 From: Goh Jin Di Date: Thu, 19 Dec 2024 06:22:22 +0000 Subject: [PATCH 16/20] Update function name and params Signed-off-by: Goh Jin Di --- lib/Service/ApiService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Service/ApiService.php b/lib/Service/ApiService.php index b879b5a..3d1a6e0 100644 --- a/lib/Service/ApiService.php +++ b/lib/Service/ApiService.php @@ -70,7 +70,7 @@ public function sendFile(int $fileId): void { ); } - public function searchMessages(string $userId, string $term, int $offset = 0, int $limit = 5): array { + public function searchDocuments(string $userId, string $term): array { $arguments = [ 'format' => 'json', 'query' => '*' . $term . '*' , From 4efb2916f3c2bb1adebdb7b8849e209bfd664c63 Mon Sep 17 00:00:00 2001 From: Goh Jin Di Date: Thu, 19 Dec 2024 06:25:48 +0000 Subject: [PATCH 17/20] Unified indentation Signed-off-by: Goh Jin Di --- lib/Search/SearchProvider.php | 150 +++++++++++++++++----------------- 1 file changed, 75 insertions(+), 75 deletions(-) diff --git a/lib/Search/SearchProvider.php b/lib/Search/SearchProvider.php index 63beff2..1a72dbd 100644 --- a/lib/Search/SearchProvider.php +++ b/lib/Search/SearchProvider.php @@ -44,81 +44,81 @@ class SearchProvider implements IProvider { - public function __construct( - private LoggerInterface $logger, - private IAppManager $appManager, - private IL10N $l10n, - private IConfig $config, - private IURLGenerator $urlGenerator, - private IDateTimeFormatter $dateTimeFormatter, - private IDateTimeZone $dateTimeZone, - private ConfigService $configService, - private ApiService $apiService, - ) { - } - - public function getId(): string { - return 'paperless-search-documents'; - } - - public function getName(): string { - return $this->l10n->t('Paperless document search result'); - } - - public function getOrder(string $route, array $routeParameters): int { - return 30; // Adjust priority as needed - } - - public function search(IUser $user, ISearchQuery $query, $page = 1, $resultsPerPage = 5): SearchResult { - $offset = ($query->getCursor() ?? 0); - $limit = $query->getLimit(); - - $term = $query->getTerm(); - - $url = $this->config->getUserValue($user->getUID(), Application::APP_ID, 'url'); - $apiKey = $this->configService->getConfig($user->getUID(), 'token'); - - if ($url === '' || $apiKey === '') { - return SearchResult::paginated($this->getName(), [], 0); - } - - $searchResult = $this->apiService->searchMessages($user->getUID(), $term); + public function __construct( + private LoggerInterface $logger, + private IAppManager $appManager, + private IL10N $l10n, + private IConfig $config, + private IURLGenerator $urlGenerator, + private IDateTimeFormatter $dateTimeFormatter, + private IDateTimeZone $dateTimeZone, + private ConfigService $configService, + private ApiService $apiService, + ) { + } + + public function getId(): string { + return 'paperless-search-documents'; + } + + public function getName(): string { + return $this->l10n->t('Paperless document search result'); + } + + public function getOrder(string $route, array $routeParameters): int { + return 30; // Adjust priority as needed + } + + public function search(IUser $user, ISearchQuery $query, $page = 1, $resultsPerPage = 5): SearchResult { + $offset = ($query->getCursor() ?? 0); + $limit = $query->getLimit(); + + $term = $query->getTerm(); + + $url = $this->config->getUserValue($user->getUID(), Application::APP_ID, 'url'); + $apiKey = $this->configService->getConfig($user->getUID(), 'token'); + + if ($url === '' || $apiKey === '') { + return SearchResult::paginated($this->getName(), [], 0); + } + + $searchResult = $this->apiService->searchMessages($user->getUID(), $term); if (isset($searchResult['html'])) { - return SearchResult::paginated($this->getName(), [], 0); - } - - // Paginate the results manually since the API does not provide offset/limit - $pagedResults = array_slice($searchResult['results'], $offset, $limit); - - $formattedResults = array_map(function (array $entry) use ($url): SearchResultEntry { - $finalThumbnailUrl = ''; - $title = $entry['title'] ?? 'Untitled'; - $context = strip_tags($entry['__search_hit__']['highlights'] ?? ''); - $link = $this->getLinkToPaperless($entry, $url); - return new SearchResultEntry( - $finalThumbnailUrl, - $title, - $context, - $link, - $finalThumbnailUrl, - true - ); - }, $pagedResults); - - return SearchResult::paginated( - $this->getName(), - $formattedResults, - $offset + $limit - ); - } - - /** - * @param array $entry - * @param string $url - * @return string - */ - protected function getLinkToPaperless(array $entry, string $url): string { - return rtrim($url, '/') . '/documents/' . ($entry['id'] ?? '#'); - } + return SearchResult::paginated($this->getName(), [], 0); + } + + // Paginate the results manually since the API does not provide offset/limit + $pagedResults = array_slice($searchResult['results'], $offset, $limit); + + $formattedResults = array_map(function (array $entry) use ($url): SearchResultEntry { + $finalThumbnailUrl = ''; + $title = $entry['title'] ?? 'Untitled'; + $context = strip_tags($entry['__search_hit__']['highlights'] ?? ''); + $link = $this->getLinkToPaperless($entry, $url); + return new SearchResultEntry( + $finalThumbnailUrl, + $title, + $context, + $link, + $finalThumbnailUrl, + true + ); + }, $pagedResults); + + return SearchResult::paginated( + $this->getName(), + $formattedResults, + $offset + $limit + ); + } + + /** + * @param array $entry + * @param string $url + * @return string + */ + protected function getLinkToPaperless(array $entry, string $url): string { + return rtrim($url, '/') . '/documents/' . ($entry['id'] ?? '#'); + } } From 3fb892428444df6933ccee0e6bc29b18214b01bd Mon Sep 17 00:00:00 2001 From: Goh Jin Di Date: Thu, 19 Dec 2024 06:46:00 +0000 Subject: [PATCH 18/20] Fix pagination Signed-off-by: Goh Jin Di --- lib/Search/SearchProvider.php | 5 +++-- lib/Service/ApiService.php | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/Search/SearchProvider.php b/lib/Search/SearchProvider.php index 1a72dbd..70ca6da 100644 --- a/lib/Search/SearchProvider.php +++ b/lib/Search/SearchProvider.php @@ -69,7 +69,7 @@ public function getOrder(string $route, array $routeParameters): int { return 30; // Adjust priority as needed } - public function search(IUser $user, ISearchQuery $query, $page = 1, $resultsPerPage = 5): SearchResult { + public function search(IUser $user, ISearchQuery $query): SearchResult { $offset = ($query->getCursor() ?? 0); $limit = $query->getLimit(); @@ -82,13 +82,14 @@ public function search(IUser $user, ISearchQuery $query, $page = 1, $resultsPerP return SearchResult::paginated($this->getName(), [], 0); } - $searchResult = $this->apiService->searchMessages($user->getUID(), $term); + $searchResult = $this->apiService->searchDocuments($user->getUID(), $term); if (isset($searchResult['html'])) { return SearchResult::paginated($this->getName(), [], 0); } // Paginate the results manually since the API does not provide offset/limit + $this->logger->warning('Debug searchResult:', ['searchResult' => $searchResult]); $pagedResults = array_slice($searchResult['results'], $offset, $limit); $formattedResults = array_map(function (array $entry) use ($url): SearchResultEntry { diff --git a/lib/Service/ApiService.php b/lib/Service/ApiService.php index 3d1a6e0..46dfaa3 100644 --- a/lib/Service/ApiService.php +++ b/lib/Service/ApiService.php @@ -91,6 +91,6 @@ public function searchDocuments(string $userId, string $term): array { $body = $result->getBody(); $json_body = json_decode($body, true, 512, JSON_THROW_ON_ERROR); - return array_slice($json_body, $offset, $limit); + return $json_body; } } From e2028b3984e4f3305924ab2f38e19751fb28c9b2 Mon Sep 17 00:00:00 2001 From: Goh Jin Di Date: Fri, 20 Dec 2024 02:16:59 +0000 Subject: [PATCH 19/20] Some changes Signed-off-by: Goh Jin Di --- lib/Search/SearchProvider.php | 11 +-- lib/Service/ApiService.php | 142 +++++++++++++++++----------------- 2 files changed, 79 insertions(+), 74 deletions(-) diff --git a/lib/Search/SearchProvider.php b/lib/Search/SearchProvider.php index 70ca6da..321c6ec 100644 --- a/lib/Search/SearchProvider.php +++ b/lib/Search/SearchProvider.php @@ -71,10 +71,11 @@ public function getOrder(string $route, array $routeParameters): int { public function search(IUser $user, ISearchQuery $query): SearchResult { $offset = ($query->getCursor() ?? 0); + $this->logger->warning('Debug offset: ', ['offset'=>$offset]); $limit = $query->getLimit(); + $this->logger->warning('Debug limit: ', ['limit'=>$limit]); $term = $query->getTerm(); - $url = $this->config->getUserValue($user->getUID(), Application::APP_ID, 'url'); $apiKey = $this->configService->getConfig($user->getUID(), 'token'); @@ -82,15 +83,15 @@ public function search(IUser $user, ISearchQuery $query): SearchResult { return SearchResult::paginated($this->getName(), [], 0); } - $searchResult = $this->apiService->searchDocuments($user->getUID(), $term); + $searchResult = $this->apiService->searchDocuments($user->getUID(), $term, $offset, $limit); if (isset($searchResult['html'])) { return SearchResult::paginated($this->getName(), [], 0); } + // $this->logger->warning('Debug searchResult' ,['searchResult' => $searchResult]); // Paginate the results manually since the API does not provide offset/limit - $this->logger->warning('Debug searchResult:', ['searchResult' => $searchResult]); - $pagedResults = array_slice($searchResult['results'], $offset, $limit); + // $pagedResults = array_slice($searchResult, $offset, $limit); $formattedResults = array_map(function (array $entry) use ($url): SearchResultEntry { $finalThumbnailUrl = ''; @@ -105,7 +106,7 @@ public function search(IUser $user, ISearchQuery $query): SearchResult { $finalThumbnailUrl, true ); - }, $pagedResults); + }, $searchResult); return SearchResult::paginated( $this->getName(), diff --git a/lib/Service/ApiService.php b/lib/Service/ApiService.php index 46dfaa3..e3a1c51 100644 --- a/lib/Service/ApiService.php +++ b/lib/Service/ApiService.php @@ -15,82 +15,86 @@ use Psr\Log\LoggerInterface; class ApiService { - private IClient $client; - private Config $config; + private IClient $client; + private Config $config; - /** @psalm-suppress PossiblyUnusedMethod */ - public function __construct( - private string $userId, - private IRootFolder $root, - ConfigService $configService, - IClientService $clientService, - private LoggerInterface $logger, - ) { - $this->client = $clientService->newClient(); - $this->config = $configService->getConfig(); - } + /** @psalm-suppress PossiblyUnusedMethod */ + public function __construct( + private string $userId, + private IRootFolder $root, + ConfigService $configService, + IClientService $clientService, + private LoggerInterface $logger, + ) { + $this->client = $clientService->newClient(); + $this->config = $configService->getConfig(); + } - /** - * @return array - */ - private function getAuthorizationHeaders(): array { - return [ - 'Authorization' => 'Token ' . $this->config->token - ]; - } + /** + * @return array + */ + private function getAuthorizationHeaders(): array { + return [ + 'Authorization' => 'Token ' . $this->config->token + ]; + } - /** - * @throws NotPermittedException - * @throws OCSBadRequestException - * @throws Exception - */ - public function sendFile(int $fileId): void { - $userFolder = $this->root->getUserFolder($this->userId); - $files = $userFolder->getById($fileId); - if (empty($files) || !$files[0] instanceof File) { - throw new OCSBadRequestException('File ID ' . $fileId . ' not found'); - } - $file = $files[0]; + /** + * @throws NotPermittedException + * @throws OCSBadRequestException + * @throws Exception + */ + public function sendFile(int $fileId): void { + $userFolder = $this->root->getUserFolder($this->userId); + $files = $userFolder->getById($fileId); + if (empty($files) || !$files[0] instanceof File) { + throw new OCSBadRequestException('File ID ' . $fileId . ' not found'); + } + $file = $files[0]; - $arguments = [ - 'document' => $file->fopen('r'), - 'title' => $file->getName(), - ]; + $arguments = [ + 'document' => $file->fopen('r'), + 'title' => $file->getName(), + ]; - $this->client->post($this->config->url . '/api/documents/post_document/', - [ - 'headers' => $this->getAuthorizationHeaders(), - 'multipart' => array_map( - static fn (string $key, mixed $value) => ['name' => $key, 'contents' => $value], - array_keys($arguments), - array_values($arguments), - ), - ], - ); - } + $this->client->post($this->config->url . '/api/documents/post_document/', + [ + 'headers' => $this->getAuthorizationHeaders(), + 'multipart' => array_map( + static fn (string $key, mixed $value) => ['name' => $key, 'contents' => $value], + array_keys($arguments), + array_values($arguments), + ), + ], + ); + } - public function searchDocuments(string $userId, string $term): array { - $arguments = [ - 'format' => 'json', - 'query' => '*' . $term . '*' , - ]; + public function searchDocuments(string $userId, string $term, int $offset, int $limit): array { + $arguments = [ + 'format' => 'json', + 'query' => '*' . $term . '*' , + ]; + + $page = intval(floor($offset / 25)) + 1; + $this->logger->warning('Debug page', ['page' => $page]); + // $arguments['page'] = $page; + + $paperlessURL = rtrim($this->config->url, '/') . '/api/documents/?' . http_build_query($arguments); + $result = $this->client->get($paperlessURL, + [ + 'headers' => array_merge( + $this->getAuthorizationHeaders(), + [ + 'Accept' => 'application/json' + ] + ) + ] + ); - $paperlessURL = rtrim($this->config->url, '/') . '/api/documents/?' . http_build_query($arguments); - $result = $this->client->get($paperlessURL, - [ - 'headers' => array_merge( - $this->getAuthorizationHeaders(), - [ - 'Accept' => 'application/json' - ] - ) - ] - ); + $body = $result->getBody(); + $json_body = json_decode($body, true, 512, JSON_THROW_ON_ERROR); - $body = $result->getBody(); - $json_body = json_decode($body, true, 512, JSON_THROW_ON_ERROR); - - return $json_body; - } + return array_slice($json_body['results'], $offset, $limit); + } } From c045eb6994543fe43dd467bd6824b75b1ef633f4 Mon Sep 17 00:00:00 2001 From: Goh Jin Di Date: Mon, 23 Dec 2024 03:25:54 +0000 Subject: [PATCH 20/20] Fix pagination Signed-off-by: Goh Jin Di --- lib/Search/SearchProvider.php | 6 -- lib/Service/ApiService.php | 157 +++++++++++++++++++--------------- 2 files changed, 86 insertions(+), 77 deletions(-) diff --git a/lib/Search/SearchProvider.php b/lib/Search/SearchProvider.php index 321c6ec..e6593ed 100644 --- a/lib/Search/SearchProvider.php +++ b/lib/Search/SearchProvider.php @@ -71,9 +71,7 @@ public function getOrder(string $route, array $routeParameters): int { public function search(IUser $user, ISearchQuery $query): SearchResult { $offset = ($query->getCursor() ?? 0); - $this->logger->warning('Debug offset: ', ['offset'=>$offset]); $limit = $query->getLimit(); - $this->logger->warning('Debug limit: ', ['limit'=>$limit]); $term = $query->getTerm(); $url = $this->config->getUserValue($user->getUID(), Application::APP_ID, 'url'); @@ -89,10 +87,6 @@ public function search(IUser $user, ISearchQuery $query): SearchResult { return SearchResult::paginated($this->getName(), [], 0); } - // $this->logger->warning('Debug searchResult' ,['searchResult' => $searchResult]); - // Paginate the results manually since the API does not provide offset/limit - // $pagedResults = array_slice($searchResult, $offset, $limit); - $formattedResults = array_map(function (array $entry) use ($url): SearchResultEntry { $finalThumbnailUrl = ''; $title = $entry['title'] ?? 'Untitled'; diff --git a/lib/Service/ApiService.php b/lib/Service/ApiService.php index e3a1c51..0130882 100644 --- a/lib/Service/ApiService.php +++ b/lib/Service/ApiService.php @@ -15,86 +15,101 @@ use Psr\Log\LoggerInterface; class ApiService { - private IClient $client; - private Config $config; + private IClient $client; + private Config $config; - /** @psalm-suppress PossiblyUnusedMethod */ - public function __construct( - private string $userId, - private IRootFolder $root, - ConfigService $configService, - IClientService $clientService, - private LoggerInterface $logger, - ) { - $this->client = $clientService->newClient(); - $this->config = $configService->getConfig(); - } + /** @psalm-suppress PossiblyUnusedMethod */ + public function __construct( + private string $userId, + private IRootFolder $root, + ConfigService $configService, + IClientService $clientService, + private LoggerInterface $logger, + ) { + $this->client = $clientService->newClient(); + $this->config = $configService->getConfig(); + } - /** - * @return array - */ - private function getAuthorizationHeaders(): array { - return [ - 'Authorization' => 'Token ' . $this->config->token - ]; - } + /** + * @return array + */ + private function getAuthorizationHeaders(): array { + return [ + 'Authorization' => 'Token ' . $this->config->token + ]; + } - /** - * @throws NotPermittedException - * @throws OCSBadRequestException - * @throws Exception - */ - public function sendFile(int $fileId): void { - $userFolder = $this->root->getUserFolder($this->userId); - $files = $userFolder->getById($fileId); - if (empty($files) || !$files[0] instanceof File) { - throw new OCSBadRequestException('File ID ' . $fileId . ' not found'); - } - $file = $files[0]; + /** + * @throws NotPermittedException + * @throws OCSBadRequestException + * @throws Exception + */ + public function sendFile(int $fileId): void { + $userFolder = $this->root->getUserFolder($this->userId); + $files = $userFolder->getById($fileId); + if (empty($files) || !$files[0] instanceof File) { + throw new OCSBadRequestException('File ID ' . $fileId . ' not found'); + } + $file = $files[0]; - $arguments = [ - 'document' => $file->fopen('r'), - 'title' => $file->getName(), - ]; + $arguments = [ + 'document' => $file->fopen('r'), + 'title' => $file->getName(), + ]; - $this->client->post($this->config->url . '/api/documents/post_document/', - [ - 'headers' => $this->getAuthorizationHeaders(), - 'multipart' => array_map( - static fn (string $key, mixed $value) => ['name' => $key, 'contents' => $value], - array_keys($arguments), - array_values($arguments), - ), - ], - ); - } + $this->client->post($this->config->url . '/api/documents/post_document/', + [ + 'headers' => $this->getAuthorizationHeaders(), + 'multipart' => array_map( + static fn (string $key, mixed $value) => ['name' => $key, 'contents' => $value], + array_keys($arguments), + array_values($arguments), + ), + ], + ); + } - public function searchDocuments(string $userId, string $term, int $offset, int $limit): array { - $arguments = [ - 'format' => 'json', - 'query' => '*' . $term . '*' , - ]; + public function searchDocuments(string $userId, string $term, int $offset, int $limit): array { + $arguments = [ + 'format' => 'json', + 'query' => '*' . $term . '*' , + ]; - $page = intval(floor($offset / 25)) + 1; - $this->logger->warning('Debug page', ['page' => $page]); - // $arguments['page'] = $page; + $allResults = []; + $currentOffset = $offset; + $remainingLimit = $limit; + $currentPage = 1; - $paperlessURL = rtrim($this->config->url, '/') . '/api/documents/?' . http_build_query($arguments); - $result = $this->client->get($paperlessURL, - [ - 'headers' => array_merge( - $this->getAuthorizationHeaders(), - [ - 'Accept' => 'application/json' - ] - ) - ] - ); + do { + $arguments['page'] = $currentPage; + $paperlessURL = rtrim($this->config->url, '/') . '/api/documents/?' . http_build_query($arguments); + + $result = $this->client->get($paperlessURL, + [ + 'headers' => array_merge( + $this->getAuthorizationHeaders(), + [ + 'Accept' => 'application/json' + ] + ) + ] + ); - $body = $result->getBody(); - $json_body = json_decode($body, true, 512, JSON_THROW_ON_ERROR); + $body = $result->getBody(); + $jsonBody = json_decode($body, true, 512, JSON_THROW_ON_ERROR); - return array_slice($json_body['results'], $offset, $limit); - } + // Merge the results into the total array, accounting for offset and limit + $currentResults = array_slice($jsonBody['results'], $currentOffset, $remainingLimit); + $allResults = array_merge($allResults, $currentResults); + + // Update pagination variables + $remainingLimit -= count($currentResults); + $currentOffset = 0; // Offset is only applied on the first page + $currentPage++; + + } while ($remainingLimit > 0 && !empty($jsonBody['results'])); + + return $allResults; + } }