diff --git a/apps/dav/openapi.json b/apps/dav/openapi.json
index 6200fbafb4f90..1e7f020e49356 100644
--- a/apps/dav/openapi.json
+++ b/apps/dav/openapi.json
@@ -177,6 +177,7 @@
"name": "expirationTime",
"in": "query",
"description": "Duration until the link expires",
+ "required": true,
"schema": {
"type": "integer",
"format": "int64"
diff --git a/apps/user_status/appinfo/routes.php b/apps/user_status/appinfo/routes.php
deleted file mode 100644
index fe534098a5887..0000000000000
--- a/apps/user_status/appinfo/routes.php
+++ /dev/null
@@ -1,43 +0,0 @@
-
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see .
- *
- */
-return [
- 'ocs' => [
- // Routes for querying statuses
- ['name' => 'Statuses#findAll', 'url' => '/api/v1/statuses', 'verb' => 'GET'],
- ['name' => 'Statuses#find', 'url' => '/api/v1/statuses/{userId}', 'verb' => 'GET'],
- // Routes for manipulating your own status
- ['name' => 'UserStatus#getStatus', 'url' => '/api/v1/user_status', 'verb' => 'GET'],
- ['name' => 'UserStatus#setStatus', 'url' => '/api/v1/user_status/status', 'verb' => 'PUT'],
- ['name' => 'UserStatus#setPredefinedMessage', 'url' => '/api/v1/user_status/message/predefined', 'verb' => 'PUT'],
- ['name' => 'UserStatus#setCustomMessage', 'url' => '/api/v1/user_status/message/custom', 'verb' => 'PUT'],
- ['name' => 'UserStatus#clearMessage', 'url' => '/api/v1/user_status/message', 'verb' => 'DELETE'],
- ['name' => 'UserStatus#revertStatus', 'url' => '/api/v1/user_status/revert/{messageId}', 'verb' => 'DELETE'],
- // Routes for listing default routes
- ['name' => 'PredefinedStatus#findAll', 'url' => '/api/v1/predefined_statuses/', 'verb' => 'GET'],
- // Route for doing heartbeats
- ['name' => 'Heartbeat#heartbeat', 'url' => '/api/v1/heartbeat', 'verb' => 'PUT'],
- ],
-];
diff --git a/apps/user_status/lib/Controller/HeartbeatController.php b/apps/user_status/lib/Controller/HeartbeatController.php
index 79e12902495fe..f78dfe716e991 100644
--- a/apps/user_status/lib/Controller/HeartbeatController.php
+++ b/apps/user_status/lib/Controller/HeartbeatController.php
@@ -30,6 +30,7 @@
use OCA\UserStatus\ResponseDefinitions;
use OCA\UserStatus\Service\StatusService;
use OCP\AppFramework\Http;
+use OCP\AppFramework\Http\Attribute\ApiRoute;
use OCP\AppFramework\Http\DataResponse;
use OCP\AppFramework\OCSController;
use OCP\AppFramework\Utility\ITimeFactory;
@@ -81,6 +82,7 @@ public function __construct(string $appName,
* 204: User has no status to keep alive
* 400: Invalid status to update
*/
+ #[ApiRoute(verb: 'PUT', url: '/api/v1/heartbeat')]
public function heartbeat(string $status): DataResponse {
if (!\in_array($status, [IUserStatus::ONLINE, IUserStatus::AWAY], true)) {
return new DataResponse([], Http::STATUS_BAD_REQUEST);
diff --git a/apps/user_status/lib/Controller/PredefinedStatusController.php b/apps/user_status/lib/Controller/PredefinedStatusController.php
index 99acdca9f79eb..74952fd12470a 100644
--- a/apps/user_status/lib/Controller/PredefinedStatusController.php
+++ b/apps/user_status/lib/Controller/PredefinedStatusController.php
@@ -29,6 +29,7 @@
use OCA\UserStatus\ResponseDefinitions;
use OCA\UserStatus\Service\PredefinedStatusService;
use OCP\AppFramework\Http;
+use OCP\AppFramework\Http\Attribute\ApiRoute;
use OCP\AppFramework\Http\DataResponse;
use OCP\AppFramework\OCSController;
use OCP\IRequest;
@@ -66,6 +67,7 @@ public function __construct(string $appName,
*
* 200: Predefined statuses returned
*/
+ #[ApiRoute(verb: 'GET', url: '/api/v1/predefined_statuses/')]
public function findAll():DataResponse {
// Filtering out the invisible one, that should only be set by API
return new DataResponse(array_filter($this->predefinedStatusService->getDefaultStatuses(), function (array $status) {
diff --git a/apps/user_status/lib/Controller/StatusesController.php b/apps/user_status/lib/Controller/StatusesController.php
index b506a691a6137..b2539af8689f9 100644
--- a/apps/user_status/lib/Controller/StatusesController.php
+++ b/apps/user_status/lib/Controller/StatusesController.php
@@ -32,6 +32,7 @@
use OCA\UserStatus\Service\StatusService;
use OCP\AppFramework\Db\DoesNotExistException;
use OCP\AppFramework\Http;
+use OCP\AppFramework\Http\Attribute\ApiRoute;
use OCP\AppFramework\Http\DataResponse;
use OCP\AppFramework\OCS\OCSNotFoundException;
use OCP\AppFramework\OCSController;
@@ -72,6 +73,7 @@ public function __construct(string $appName,
*
* 200: Statuses returned
*/
+ #[ApiRoute(verb: 'GET', url: '/api/v1/statuses')]
public function findAll(?int $limit = null, ?int $offset = null): DataResponse {
$allStatuses = $this->service->findAll($limit, $offset);
@@ -91,6 +93,7 @@ public function findAll(?int $limit = null, ?int $offset = null): DataResponse {
*
* 200: Status returned
*/
+ #[ApiRoute(verb: 'GET', url: '/api/v1/statuses/{userId}')]
public function find(string $userId): DataResponse {
try {
$userStatus = $this->service->findByUserId($userId);
diff --git a/apps/user_status/lib/Controller/UserStatusController.php b/apps/user_status/lib/Controller/UserStatusController.php
index d06370a19eada..736c4e772ca59 100644
--- a/apps/user_status/lib/Controller/UserStatusController.php
+++ b/apps/user_status/lib/Controller/UserStatusController.php
@@ -39,6 +39,7 @@
use OCA\UserStatus\Service\StatusService;
use OCP\AppFramework\Db\DoesNotExistException;
use OCP\AppFramework\Http;
+use OCP\AppFramework\Http\Attribute\ApiRoute;
use OCP\AppFramework\Http\DataResponse;
use OCP\AppFramework\OCS\OCSBadRequestException;
use OCP\AppFramework\OCS\OCSNotFoundException;
@@ -72,6 +73,7 @@ public function __construct(
*
* 200: The status was found successfully
*/
+ #[ApiRoute(verb: 'GET', url: '/api/v1/user_status')]
public function getStatus(): DataResponse {
try {
$this->calendarStatusService->processCalendarStatus($this->userId);
@@ -94,6 +96,7 @@ public function getStatus(): DataResponse {
*
* 200: The status was updated successfully
*/
+ #[ApiRoute(verb: 'PUT', url: '/api/v1/user_status/status')]
public function setStatus(string $statusType): DataResponse {
try {
$status = $this->service->setStatus($this->userId, $statusType, null, true);
@@ -118,6 +121,7 @@ public function setStatus(string $statusType): DataResponse {
*
* 200: The message was updated successfully
*/
+ #[ApiRoute(verb: 'PUT', url: '/api/v1/user_status/message/predefined')]
public function setPredefinedMessage(string $messageId,
?int $clearAt): DataResponse {
try {
@@ -146,6 +150,7 @@ public function setPredefinedMessage(string $messageId,
*
* 200: The message was updated successfully
*/
+ #[ApiRoute(verb: 'PUT', url: '/api/v1/user_status/message/custom')]
public function setCustomMessage(?string $statusIcon,
?string $message,
?int $clearAt): DataResponse {
@@ -179,6 +184,7 @@ public function setCustomMessage(?string $statusIcon,
*
* 200: Message cleared successfully
*/
+ #[ApiRoute(verb: 'DELETE', url: '/api/v1/user_status/message')]
public function clearMessage(): DataResponse {
$this->service->clearMessage($this->userId);
return new DataResponse([]);
@@ -195,6 +201,7 @@ public function clearMessage(): DataResponse {
*
* 200: Status reverted
*/
+ #[ApiRoute(verb: 'DELETE', url: '/api/v1/user_status/revert/{messageId}')]
public function revertStatus(string $messageId): DataResponse {
$backupStatus = $this->service->revertUserStatus($this->userId, $messageId, true);
if ($backupStatus) {
diff --git a/apps/user_status/openapi.json b/apps/user_status/openapi.json
index 2d76f8760ee26..009973bc195f4 100644
--- a/apps/user_status/openapi.json
+++ b/apps/user_status/openapi.json
@@ -206,6 +206,224 @@
}
},
"paths": {
+ "/ocs/v2.php/apps/user_status/api/v1/heartbeat": {
+ "put": {
+ "operationId": "heartbeat-heartbeat",
+ "summary": "Keep the status alive",
+ "tags": [
+ "heartbeat"
+ ],
+ "security": [
+ {
+ "bearer_auth": []
+ },
+ {
+ "basic_auth": []
+ }
+ ],
+ "parameters": [
+ {
+ "name": "status",
+ "in": "query",
+ "description": "Only online, away",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "OCS-APIRequest",
+ "in": "header",
+ "description": "Required to be true for the API request to pass",
+ "required": true,
+ "schema": {
+ "type": "boolean",
+ "default": true
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Status successfully updated",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "ocs"
+ ],
+ "properties": {
+ "ocs": {
+ "type": "object",
+ "required": [
+ "meta",
+ "data"
+ ],
+ "properties": {
+ "meta": {
+ "$ref": "#/components/schemas/OCSMeta"
+ },
+ "data": {
+ "$ref": "#/components/schemas/Private"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Invalid status to update",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "ocs"
+ ],
+ "properties": {
+ "ocs": {
+ "type": "object",
+ "required": [
+ "meta",
+ "data"
+ ],
+ "properties": {
+ "meta": {
+ "$ref": "#/components/schemas/OCSMeta"
+ },
+ "data": {}
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "ocs"
+ ],
+ "properties": {
+ "ocs": {
+ "type": "object",
+ "required": [
+ "meta",
+ "data"
+ ],
+ "properties": {
+ "meta": {
+ "$ref": "#/components/schemas/OCSMeta"
+ },
+ "data": {}
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "204": {
+ "description": "User has no status to keep alive",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "ocs"
+ ],
+ "properties": {
+ "ocs": {
+ "type": "object",
+ "required": [
+ "meta",
+ "data"
+ ],
+ "properties": {
+ "meta": {
+ "$ref": "#/components/schemas/OCSMeta"
+ },
+ "data": {}
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/ocs/v2.php/apps/user_status/api/v1/predefined_statuses": {
+ "get": {
+ "operationId": "predefined_status-find-all",
+ "summary": "Get all predefined messages",
+ "tags": [
+ "predefined_status"
+ ],
+ "security": [
+ {
+ "bearer_auth": []
+ },
+ {
+ "basic_auth": []
+ }
+ ],
+ "parameters": [
+ {
+ "name": "OCS-APIRequest",
+ "in": "header",
+ "description": "Required to be true for the API request to pass",
+ "required": true,
+ "schema": {
+ "type": "boolean",
+ "default": true
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Predefined statuses returned",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "ocs"
+ ],
+ "properties": {
+ "ocs": {
+ "type": "object",
+ "required": [
+ "meta",
+ "data"
+ ],
+ "properties": {
+ "meta": {
+ "$ref": "#/components/schemas/OCSMeta"
+ },
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/Predefined"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
"/ocs/v2.php/apps/user_status/api/v1/statuses": {
"get": {
"operationId": "statuses-find-all",
@@ -846,224 +1064,6 @@
}
}
}
- },
- "/ocs/v2.php/apps/user_status/api/v1/predefined_statuses": {
- "get": {
- "operationId": "predefined_status-find-all",
- "summary": "Get all predefined messages",
- "tags": [
- "predefined_status"
- ],
- "security": [
- {
- "bearer_auth": []
- },
- {
- "basic_auth": []
- }
- ],
- "parameters": [
- {
- "name": "OCS-APIRequest",
- "in": "header",
- "description": "Required to be true for the API request to pass",
- "required": true,
- "schema": {
- "type": "boolean",
- "default": true
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Predefined statuses returned",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "required": [
- "ocs"
- ],
- "properties": {
- "ocs": {
- "type": "object",
- "required": [
- "meta",
- "data"
- ],
- "properties": {
- "meta": {
- "$ref": "#/components/schemas/OCSMeta"
- },
- "data": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/Predefined"
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- },
- "/ocs/v2.php/apps/user_status/api/v1/heartbeat": {
- "put": {
- "operationId": "heartbeat-heartbeat",
- "summary": "Keep the status alive",
- "tags": [
- "heartbeat"
- ],
- "security": [
- {
- "bearer_auth": []
- },
- {
- "basic_auth": []
- }
- ],
- "parameters": [
- {
- "name": "status",
- "in": "query",
- "description": "Only online, away",
- "required": true,
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "OCS-APIRequest",
- "in": "header",
- "description": "Required to be true for the API request to pass",
- "required": true,
- "schema": {
- "type": "boolean",
- "default": true
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Status successfully updated",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "required": [
- "ocs"
- ],
- "properties": {
- "ocs": {
- "type": "object",
- "required": [
- "meta",
- "data"
- ],
- "properties": {
- "meta": {
- "$ref": "#/components/schemas/OCSMeta"
- },
- "data": {
- "$ref": "#/components/schemas/Private"
- }
- }
- }
- }
- }
- }
- }
- },
- "400": {
- "description": "Invalid status to update",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "required": [
- "ocs"
- ],
- "properties": {
- "ocs": {
- "type": "object",
- "required": [
- "meta",
- "data"
- ],
- "properties": {
- "meta": {
- "$ref": "#/components/schemas/OCSMeta"
- },
- "data": {}
- }
- }
- }
- }
- }
- }
- },
- "500": {
- "description": "",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "required": [
- "ocs"
- ],
- "properties": {
- "ocs": {
- "type": "object",
- "required": [
- "meta",
- "data"
- ],
- "properties": {
- "meta": {
- "$ref": "#/components/schemas/OCSMeta"
- },
- "data": {}
- }
- }
- }
- }
- }
- }
- },
- "204": {
- "description": "User has no status to keep alive",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "required": [
- "ocs"
- ],
- "properties": {
- "ocs": {
- "type": "object",
- "required": [
- "meta",
- "data"
- ],
- "properties": {
- "meta": {
- "$ref": "#/components/schemas/OCSMeta"
- },
- "data": {}
- }
- }
- }
- }
- }
- }
- }
- }
- }
}
},
"tags": []
diff --git a/core/Controller/AppPasswordController.php b/core/Controller/AppPasswordController.php
index 2575729fe850c..11aca8ef32931 100644
--- a/core/Controller/AppPasswordController.php
+++ b/core/Controller/AppPasswordController.php
@@ -33,6 +33,7 @@
use OC\Authentication\Token\IToken;
use OC\User\Session;
use OCP\AppFramework\Http;
+use OCP\AppFramework\Http\Attribute\ApiRoute;
use OCP\AppFramework\Http\Attribute\UseSession;
use OCP\AppFramework\Http\DataResponse;
use OCP\AppFramework\OCS\OCSForbiddenException;
@@ -74,6 +75,7 @@ public function __construct(
*
* 200: App password returned
*/
+ #[ApiRoute(verb: 'GET', url: '/getapppassword', root: '/core')]
public function getAppPassword(): DataResponse {
// We do not allow the creation of new tokens if this is an app password
if ($this->session->exists('app_password')) {
@@ -125,6 +127,7 @@ public function getAppPassword(): DataResponse {
*
* 200: App password deleted successfully
*/
+ #[ApiRoute(verb: 'DELETE', url: '/apppassword', root: '/core')]
public function deleteAppPassword(): DataResponse {
if (!$this->session->exists('app_password')) {
throw new OCSForbiddenException('no app password in use');
@@ -152,6 +155,7 @@ public function deleteAppPassword(): DataResponse {
*
* 200: App password returned
*/
+ #[ApiRoute(verb: 'POST', url: '/apppassword/rotate', root: '/core')]
public function rotateAppPassword(): DataResponse {
if (!$this->session->exists('app_password')) {
throw new OCSForbiddenException('no app password in use');
@@ -187,6 +191,7 @@ public function rotateAppPassword(): DataResponse {
* 403: Password confirmation failed
*/
#[UseSession]
+ #[ApiRoute(verb: 'PUT', url: '/apppassword/confirm', root: '/core')]
public function confirmUserPassword(string $password): DataResponse {
$loginName = $this->userSession->getLoginName();
$loginResult = $this->userManager->checkPassword($loginName, $password);
diff --git a/core/Controller/AutoCompleteController.php b/core/Controller/AutoCompleteController.php
index c873603fd0e5f..20170546ce562 100644
--- a/core/Controller/AutoCompleteController.php
+++ b/core/Controller/AutoCompleteController.php
@@ -32,6 +32,7 @@
use OCA\Core\ResponseDefinitions;
use OCP\AppFramework\Http;
+use OCP\AppFramework\Http\Attribute\ApiRoute;
use OCP\AppFramework\Http\DataResponse;
use OCP\AppFramework\OCSController;
use OCP\Collaboration\AutoComplete\AutoCompleteEvent;
@@ -72,6 +73,7 @@ public function __construct(
*
* 200: Autocomplete results returned
*/
+ #[ApiRoute(verb: 'GET', url: '/autocomplete/get', root: '/core')]
public function get(string $search, ?string $itemType, ?string $itemId, ?string $sorter = null, array $shareTypes = [IShare::TYPE_USER], int $limit = 10): DataResponse {
// if enumeration/user listings are disabled, we'll receive an empty
// result from search() – thus nothing else to do here.
diff --git a/core/Controller/AvatarController.php b/core/Controller/AvatarController.php
index 32858b526122b..03f59fd6439e6 100644
--- a/core/Controller/AvatarController.php
+++ b/core/Controller/AvatarController.php
@@ -34,6 +34,7 @@
use OC\AppFramework\Utility\TimeFactory;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http;
+use OCP\AppFramework\Http\Attribute\FrontpageRoute;
use OCP\AppFramework\Http\DataDisplayResponse;
use OCP\AppFramework\Http\FileDisplayResponse;
use OCP\AppFramework\Http\JSONResponse;
@@ -82,6 +83,7 @@ public function __construct(
* 200: Avatar returned
* 404: Avatar not found
*/
+ #[FrontpageRoute(verb: 'GET', url: '/avatar/{userId}/{size}/dark')]
public function getAvatarDark(string $userId, int $size) {
if ($size <= 64) {
if ($size !== 64) {
@@ -128,6 +130,7 @@ public function getAvatarDark(string $userId, int $size) {
* 200: Avatar returned
* 404: Avatar not found
*/
+ #[FrontpageRoute(verb: 'GET', url: '/avatar/{userId}/{size}')]
public function getAvatar(string $userId, int $size) {
if ($size <= 64) {
if ($size !== 64) {
@@ -161,6 +164,7 @@ public function getAvatar(string $userId, int $size) {
/**
* @NoAdminRequired
*/
+ #[FrontpageRoute(verb: 'POST', url: '/avatar/')]
public function postAvatar(?string $path = null): JSONResponse {
$files = $this->request->getUploadedFile('files');
@@ -283,6 +287,7 @@ public function postAvatar(?string $path = null): JSONResponse {
/**
* @NoAdminRequired
*/
+ #[FrontpageRoute(verb: 'DELETE', url: '/avatar/')]
public function deleteAvatar(): JSONResponse {
try {
$avatar = $this->avatarManager->getAvatar($this->userId);
@@ -299,6 +304,7 @@ public function deleteAvatar(): JSONResponse {
*
* @return JSONResponse|DataDisplayResponse
*/
+ #[FrontpageRoute(verb: 'GET', url: '/avatar/tmp')]
public function getTmpAvatar() {
$tmpAvatar = $this->cache->get('tmpAvatar');
if (is_null($tmpAvatar)) {
@@ -325,6 +331,7 @@ public function getTmpAvatar() {
/**
* @NoAdminRequired
*/
+ #[FrontpageRoute(verb: 'POST', url: '/avatar/cropped')]
public function postCroppedAvatar(?array $crop = null): JSONResponse {
if (is_null($crop)) {
return new JSONResponse(['data' => ['message' => $this->l10n->t("No crop data provided")]],
diff --git a/core/Controller/CSRFTokenController.php b/core/Controller/CSRFTokenController.php
index 046d809702c8e..13ea0011146db 100644
--- a/core/Controller/CSRFTokenController.php
+++ b/core/Controller/CSRFTokenController.php
@@ -30,6 +30,7 @@
use OC\Security\CSRF\CsrfTokenManager;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http;
+use OCP\AppFramework\Http\Attribute\FrontpageRoute;
use OCP\AppFramework\Http\Attribute\OpenAPI;
use OCP\AppFramework\Http\JSONResponse;
use OCP\IRequest;
@@ -49,6 +50,7 @@ public function __construct(
* @NoCSRFRequired
* @PublicPage
*/
+ #[FrontpageRoute(verb: 'GET', url: '/csrftoken')]
public function index(): JSONResponse {
if (!$this->request->passesStrictCookieCheck()) {
return new JSONResponse([], Http::STATUS_FORBIDDEN);
diff --git a/core/Controller/ClientFlowLoginController.php b/core/Controller/ClientFlowLoginController.php
index d6e381b36740c..76079e710e3ae 100644
--- a/core/Controller/ClientFlowLoginController.php
+++ b/core/Controller/ClientFlowLoginController.php
@@ -41,6 +41,7 @@
use OCA\OAuth2\Db\ClientMapper;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http;
+use OCP\AppFramework\Http\Attribute\FrontpageRoute;
use OCP\AppFramework\Http\Attribute\OpenAPI;
use OCP\AppFramework\Http\Attribute\UseSession;
use OCP\AppFramework\Http\Response;
@@ -113,6 +114,7 @@ private function stateTokenForbiddenResponse(): StandaloneTemplateResponse {
* @NoCSRFRequired
*/
#[UseSession]
+ #[FrontpageRoute(verb: 'GET', url: '/login/flow')]
public function showAuthPickerPage(string $clientIdentifier = '', string $user = '', int $direct = 0): StandaloneTemplateResponse {
$clientName = $this->getClientName();
$client = null;
@@ -180,6 +182,7 @@ public function showAuthPickerPage(string $clientIdentifier = '', string $user =
* @NoSameSiteCookieRequired
*/
#[UseSession]
+ #[FrontpageRoute(verb: 'GET', url: '/login/flow/grant')]
public function grantPage(string $stateToken = '',
string $clientIdentifier = '',
int $direct = 0): StandaloneTemplateResponse {
@@ -232,6 +235,7 @@ public function grantPage(string $stateToken = '',
* @return Http\RedirectResponse|Response
*/
#[UseSession]
+ #[FrontpageRoute(verb: 'POST', url: '/login/flow')]
public function generateAppPassword(string $stateToken,
string $clientIdentifier = '') {
if (!$this->isValidToken($stateToken)) {
@@ -323,6 +327,7 @@ public function generateAppPassword(string $stateToken,
/**
* @PublicPage
*/
+ #[FrontpageRoute(verb: 'POST', url: '/login/flow/apptoken')]
public function apptokenRedirect(string $stateToken, string $user, string $password): Response {
if (!$this->isValidToken($stateToken)) {
return $this->stateTokenForbiddenResponse();
diff --git a/core/Controller/ClientFlowLoginV2Controller.php b/core/Controller/ClientFlowLoginV2Controller.php
index f5bd2d216dde3..19c1f9ce2514b 100644
--- a/core/Controller/ClientFlowLoginV2Controller.php
+++ b/core/Controller/ClientFlowLoginV2Controller.php
@@ -33,6 +33,7 @@
use OCA\Core\ResponseDefinitions;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http;
+use OCP\AppFramework\Http\Attribute\FrontpageRoute;
use OCP\AppFramework\Http\Attribute\OpenAPI;
use OCP\AppFramework\Http\Attribute\UseSession;
use OCP\AppFramework\Http\JSONResponse;
@@ -84,6 +85,7 @@ public function __construct(
* 200: Login flow credentials returned
* 404: Login flow not found or completed
*/
+ #[FrontpageRoute(verb: 'POST', url: '/login/v2/poll')]
public function poll(string $token): JSONResponse {
try {
$creds = $this->loginFlowV2Service->poll($token);
@@ -100,6 +102,7 @@ public function poll(string $token): JSONResponse {
*/
#[OpenAPI(scope: OpenAPI::SCOPE_IGNORE)]
#[UseSession]
+ #[FrontpageRoute(verb: 'GET', url: '/login/v2/flow/{token}')]
public function landing(string $token, $user = ''): Response {
if (!$this->loginFlowV2Service->startLoginFlow($token)) {
return $this->loginTokenForbiddenResponse();
@@ -118,6 +121,7 @@ public function landing(string $token, $user = ''): Response {
*/
#[OpenAPI(scope: OpenAPI::SCOPE_IGNORE)]
#[UseSession]
+ #[FrontpageRoute(verb: 'GET', url: '/login/v2/flow')]
public function showAuthPickerPage($user = ''): StandaloneTemplateResponse {
try {
$flow = $this->getFlowByLoginToken();
@@ -152,6 +156,7 @@ public function showAuthPickerPage($user = ''): StandaloneTemplateResponse {
*/
#[OpenAPI(scope: OpenAPI::SCOPE_IGNORE)]
#[UseSession]
+ #[FrontpageRoute(verb: 'GET', url: '/login/v2/grant')]
public function grantPage(?string $stateToken): StandaloneTemplateResponse {
if ($stateToken === null) {
return $this->stateTokenMissingResponse();
@@ -187,6 +192,7 @@ public function grantPage(?string $stateToken): StandaloneTemplateResponse {
/**
* @PublicPage
*/
+ #[FrontpageRoute(verb: 'POST', url: '/login/v2/apptoken')]
public function apptokenRedirect(?string $stateToken, string $user, string $password) {
if ($stateToken === null) {
return $this->stateTokenMissingResponse();
@@ -234,6 +240,7 @@ public function apptokenRedirect(?string $stateToken, string $user, string $pass
* @NoAdminRequired
*/
#[UseSession]
+ #[FrontpageRoute(verb: 'POST', url: '/login/v2/grant')]
public function generateAppPassword(?string $stateToken): Response {
if ($stateToken === null) {
return $this->stateTokenMissingResponse();
@@ -291,6 +298,7 @@ private function handleFlowDone(bool $result): StandaloneTemplateResponse {
*
* 200: Login flow init returned
*/
+ #[FrontpageRoute(verb: 'POST', url: '/login/v2')]
public function init(): JSONResponse {
// Get client user agent
$userAgent = $this->request->getHeader('USER_AGENT');
diff --git a/core/Controller/CollaborationResourcesController.php b/core/Controller/CollaborationResourcesController.php
index e1389309c15c3..9d7d714846841 100644
--- a/core/Controller/CollaborationResourcesController.php
+++ b/core/Controller/CollaborationResourcesController.php
@@ -32,6 +32,7 @@
use Exception;
use OCA\Core\ResponseDefinitions;
use OCP\AppFramework\Http;
+use OCP\AppFramework\Http\Attribute\ApiRoute;
use OCP\AppFramework\Http\DataResponse;
use OCP\AppFramework\OCSController;
use OCP\Collaboration\Resources\CollectionException;
@@ -84,6 +85,7 @@ protected function getCollection(int $collectionId): ICollection {
* 200: Collection returned
* 404: Collection not found
*/
+ #[ApiRoute(verb: 'GET', url: '/resources/collections/{collectionId}', root: '/collaboration')]
public function listCollection(int $collectionId): DataResponse {
try {
$collection = $this->getCollection($collectionId);
@@ -105,6 +107,7 @@ public function listCollection(int $collectionId): DataResponse {
* 200: Collections returned
* 404: Collection not found
*/
+ #[ApiRoute(verb: 'GET', url: '/resources/collections/search/{filter}', root: '/collaboration')]
public function searchCollections(string $filter): DataResponse {
try {
$collections = $this->manager->searchCollections($this->userSession->getUser(), $filter);
@@ -128,6 +131,7 @@ public function searchCollections(string $filter): DataResponse {
* 200: Collection returned
* 404: Collection not found or resource inaccessible
*/
+ #[ApiRoute(verb: 'POST', url: '/resources/collections/{collectionId}', root: '/collaboration')]
public function addResource(int $collectionId, string $resourceType, string $resourceId): DataResponse {
try {
$collection = $this->getCollection($collectionId);
@@ -162,6 +166,7 @@ public function addResource(int $collectionId, string $resourceType, string $res
* 200: Collection returned
* 404: Collection or resource not found
*/
+ #[ApiRoute(verb: 'DELETE', url: '/resources/collections/{collectionId}', root: '/collaboration')]
public function removeResource(int $collectionId, string $resourceType, string $resourceId): DataResponse {
try {
$collection = $this->getCollection($collectionId);
@@ -192,6 +197,7 @@ public function removeResource(int $collectionId, string $resourceType, string $
* 200: Collections returned
* 404: Resource not accessible
*/
+ #[ApiRoute(verb: 'GET', url: '/resources/{resourceType}/{resourceId}', root: '/collaboration')]
public function getCollectionsByResource(string $resourceType, string $resourceId): DataResponse {
try {
$resource = $this->manager->getResourceForUser($resourceType, $resourceId, $this->userSession->getUser());
@@ -220,6 +226,7 @@ public function getCollectionsByResource(string $resourceType, string $resourceI
* 400: Creating collection is not possible
* 404: Resource inaccessible
*/
+ #[ApiRoute(verb: 'POST', url: '/resources/{baseResourceType}/{baseResourceId}', root: '/collaboration')]
public function createCollectionOnResource(string $baseResourceType, string $baseResourceId, string $name): DataResponse {
if (!isset($name[0]) || isset($name[64])) {
return new DataResponse([], Http::STATUS_BAD_REQUEST);
@@ -253,6 +260,7 @@ public function createCollectionOnResource(string $baseResourceType, string $bas
* 200: Collection returned
* 404: Collection not found
*/
+ #[ApiRoute(verb: 'PUT', url: '/resources/collections/{collectionId}', root: '/collaboration')]
public function renameCollection(int $collectionId, string $collectionName): DataResponse {
try {
$collection = $this->getCollection($collectionId);
diff --git a/core/Controller/ContactsMenuController.php b/core/Controller/ContactsMenuController.php
index 7b8f2e50aa54a..e70349970a3e6 100644
--- a/core/Controller/ContactsMenuController.php
+++ b/core/Controller/ContactsMenuController.php
@@ -28,6 +28,7 @@
use OC\Contacts\ContactsMenu\Manager;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http;
+use OCP\AppFramework\Http\Attribute\FrontpageRoute;
use OCP\AppFramework\Http\JSONResponse;
use OCP\IRequest;
use OCP\IUserSession;
@@ -47,6 +48,7 @@ public function __construct(
* @return \JsonSerializable[]
* @throws Exception
*/
+ #[FrontpageRoute(verb: 'POST', url: '/contactsmenu/contacts')]
public function index(?string $filter = null): array {
return $this->manager->getEntries($this->userSession->getUser(), $filter);
}
@@ -57,6 +59,7 @@ public function index(?string $filter = null): array {
* @return JSONResponse|\JsonSerializable
* @throws Exception
*/
+ #[FrontpageRoute(verb: 'POST', url: '/contactsmenu/findOne')]
public function findOne(int $shareType, string $shareWith) {
$contact = $this->manager->findOne($this->userSession->getUser(), $shareType, $shareWith);
diff --git a/core/Controller/CssController.php b/core/Controller/CssController.php
index 6d12309366124..3fd0c524b06bb 100644
--- a/core/Controller/CssController.php
+++ b/core/Controller/CssController.php
@@ -34,6 +34,7 @@
use OC\Files\AppData\Factory;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http;
+use OCP\AppFramework\Http\Attribute\FrontpageRoute;
use OCP\AppFramework\Http\Attribute\OpenAPI;
use OCP\AppFramework\Http\FileDisplayResponse;
use OCP\AppFramework\Http\NotFoundResponse;
@@ -69,6 +70,7 @@ public function __construct(
* @param string $appName css folder name
* @return FileDisplayResponse|NotFoundResponse
*/
+ #[FrontpageRoute(verb: 'GET', url: '/css/{appName}/{fileName}')]
public function getCss(string $fileName, string $appName): Response {
try {
$folder = $this->appData->getFolder($appName);
diff --git a/core/Controller/ErrorController.php b/core/Controller/ErrorController.php
index 0bc9e605e13fc..040b75be87b2c 100644
--- a/core/Controller/ErrorController.php
+++ b/core/Controller/ErrorController.php
@@ -28,6 +28,7 @@
namespace OC\Core\Controller;
use OCP\AppFramework\Http;
+use OCP\AppFramework\Http\Attribute\FrontpageRoute;
use OCP\AppFramework\Http\Attribute\OpenAPI;
use OCP\AppFramework\Http\TemplateResponse;
@@ -37,6 +38,7 @@ class ErrorController extends \OCP\AppFramework\Controller {
* @PublicPage
* @NoCSRFRequired
*/
+ #[FrontpageRoute(verb: 'GET', url: 'error/403')]
public function error403(): TemplateResponse {
$response = new TemplateResponse(
'core',
@@ -52,6 +54,7 @@ public function error403(): TemplateResponse {
* @PublicPage
* @NoCSRFRequired
*/
+ #[FrontpageRoute(verb: 'GET', url: 'error/404')]
public function error404(): TemplateResponse {
$response = new TemplateResponse(
'core',
diff --git a/core/Controller/GuestAvatarController.php b/core/Controller/GuestAvatarController.php
index 3270a1f7f5aae..5e6f2438dd68a 100644
--- a/core/Controller/GuestAvatarController.php
+++ b/core/Controller/GuestAvatarController.php
@@ -25,6 +25,7 @@
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http;
+use OCP\AppFramework\Http\Attribute\FrontpageRoute;
use OCP\AppFramework\Http\FileDisplayResponse;
use OCP\AppFramework\Http\Response;
use OCP\IAvatarManager;
@@ -61,6 +62,7 @@ public function __construct(
* 200: Custom avatar returned
* 201: Avatar returned
*/
+ #[FrontpageRoute(verb: 'GET', url: '/avatar/guest/{guestName}/{size}')]
public function getAvatar(string $guestName, string $size, ?bool $darkTheme = false) {
$size = (int) $size;
$darkTheme = $darkTheme ?? false;
@@ -113,6 +115,7 @@ public function getAvatar(string $guestName, string $size, ?bool $darkTheme = fa
* 200: Custom avatar returned
* 201: Avatar returned
*/
+ #[FrontpageRoute(verb: 'GET', url: '/avatar/guest/{guestName}/{size}/dark')]
public function getAvatarDark(string $guestName, string $size) {
return $this->getAvatar($guestName, $size, true);
}
diff --git a/core/Controller/HoverCardController.php b/core/Controller/HoverCardController.php
index ac1b809ba0c0a..705d506057a9d 100644
--- a/core/Controller/HoverCardController.php
+++ b/core/Controller/HoverCardController.php
@@ -28,6 +28,7 @@
use OC\Contacts\ContactsMenu\Manager;
use OCA\Core\ResponseDefinitions;
use OCP\AppFramework\Http;
+use OCP\AppFramework\Http\Attribute\ApiRoute;
use OCP\AppFramework\Http\DataResponse;
use OCP\IRequest;
use OCP\IUserSession;
@@ -56,6 +57,7 @@ public function __construct(
* 200: Account details returned
* 404: Account not found
*/
+ #[ApiRoute(verb: 'GET', url: '/v1/{userId}', root: '/hovercard')]
public function getUser(string $userId): DataResponse {
$contact = $this->manager->findOne($this->userSession->getUser(), IShare::TYPE_USER, $userId);
diff --git a/core/Controller/JsController.php b/core/Controller/JsController.php
index 213231eb85448..1f504e05ed05d 100644
--- a/core/Controller/JsController.php
+++ b/core/Controller/JsController.php
@@ -34,6 +34,7 @@
use OC\Files\AppData\Factory;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http;
+use OCP\AppFramework\Http\Attribute\FrontpageRoute;
use OCP\AppFramework\Http\Attribute\OpenAPI;
use OCP\AppFramework\Http\FileDisplayResponse;
use OCP\AppFramework\Http\NotFoundResponse;
@@ -69,6 +70,7 @@ public function __construct(
* @param string $appName js folder name
* @return FileDisplayResponse|NotFoundResponse
*/
+ #[FrontpageRoute(verb: 'GET', url: '/js/{appName}/{fileName}')]
public function getJs(string $fileName, string $appName): Response {
try {
$folder = $this->appData->getFolder($appName);
diff --git a/core/Controller/LoginController.php b/core/Controller/LoginController.php
index 9e5eab4feceb7..e8c08f134be4c 100644
--- a/core/Controller/LoginController.php
+++ b/core/Controller/LoginController.php
@@ -43,6 +43,7 @@
use OC_App;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http;
+use OCP\AppFramework\Http\Attribute\FrontpageRoute;
use OCP\AppFramework\Http\Attribute\NoCSRFRequired;
use OCP\AppFramework\Http\Attribute\OpenAPI;
use OCP\AppFramework\Http\Attribute\UseSession;
@@ -91,6 +92,7 @@ public function __construct(
* @return RedirectResponse
*/
#[UseSession]
+ #[FrontpageRoute(verb: 'GET', url: '/logout')]
public function logout() {
$loginToken = $this->request->getCookie('nc_token');
if (!is_null($loginToken)) {
@@ -127,6 +129,7 @@ public function logout() {
*/
#[UseSession]
#[OpenAPI(scope: OpenAPI::SCOPE_IGNORE)]
+ #[FrontpageRoute(verb: 'GET', url: '/login')]
public function showLoginForm(string $user = null, string $redirect_url = null): Http\Response {
if ($this->userSession->isLoggedIn()) {
return new RedirectResponse($this->urlGenerator->linkToDefaultPageUrl());
@@ -276,6 +279,7 @@ private function generateRedirect(?string $redirectUrl): RedirectResponse {
*/
#[UseSession]
#[OpenAPI(scope: OpenAPI::SCOPE_IGNORE)]
+ #[FrontpageRoute(verb: 'POST', url: '/login')]
public function tryLogin(Chain $loginChain,
string $user = '',
string $password = '',
@@ -370,6 +374,7 @@ private function createLoginFailedResponse(
*/
#[UseSession]
#[NoCSRFRequired]
+ #[FrontpageRoute(verb: 'POST', url: '/login/confirm')]
public function confirmPassword(string $password): DataResponse {
$loginName = $this->userSession->getLoginName();
$loginResult = $this->userManager->checkPassword($loginName, $password);
diff --git a/core/Controller/LostController.php b/core/Controller/LostController.php
index 2a0d374b55212..8e9a9e0f0de58 100644
--- a/core/Controller/LostController.php
+++ b/core/Controller/LostController.php
@@ -44,6 +44,7 @@
use OC\Security\RateLimiting\Exception\RateLimitExceededException;
use OC\Security\RateLimiting\Limiter;
use OCP\AppFramework\Controller;
+use OCP\AppFramework\Http\Attribute\FrontpageRoute;
use OCP\AppFramework\Http\Attribute\OpenAPI;
use OCP\AppFramework\Http\JSONResponse;
use OCP\AppFramework\Http\TemplateResponse;
@@ -108,6 +109,7 @@ public function __construct(
* @BruteForceProtection(action=passwordResetEmail)
* @AnonRateThrottle(limit=10, period=300)
*/
+ #[FrontpageRoute(verb: 'GET', url: '/lostpassword/reset/form/{token}/{userId}')]
public function resetform(string $token, string $userId): TemplateResponse {
try {
$this->checkPasswordResetToken($token, $userId);
@@ -172,6 +174,7 @@ private function success(array $data = []): array {
* @BruteForceProtection(action=passwordResetEmail)
* @AnonRateThrottle(limit=10, period=300)
*/
+ #[FrontpageRoute(verb: 'POST', url: '/lostpassword/email')]
public function email(string $user): JSONResponse {
if ($this->config->getSystemValue('lost_password_link', '') !== '') {
return new JSONResponse($this->error($this->l10n->t('Password reset is disabled')));
@@ -205,6 +208,7 @@ public function email(string $user): JSONResponse {
* @BruteForceProtection(action=passwordResetEmail)
* @AnonRateThrottle(limit=10, period=300)
*/
+ #[FrontpageRoute(verb: 'POST', url: '/lostpassword/set/{token}/{userId}')]
public function setPassword(string $token, string $userId, string $password, bool $proceed): JSONResponse {
if ($this->encryptionManager->isEnabled() && !$proceed) {
$encryptionModules = $this->encryptionManager->getEncryptionModules();
diff --git a/core/Controller/NavigationController.php b/core/Controller/NavigationController.php
index 0996b41042ed5..7b651e6ec7000 100644
--- a/core/Controller/NavigationController.php
+++ b/core/Controller/NavigationController.php
@@ -25,6 +25,7 @@
use OCA\Core\ResponseDefinitions;
use OCP\AppFramework\Http;
+use OCP\AppFramework\Http\Attribute\ApiRoute;
use OCP\AppFramework\Http\DataResponse;
use OCP\AppFramework\OCSController;
use OCP\INavigationManager;
@@ -56,6 +57,7 @@ public function __construct(
* 200: Apps navigation returned
* 304: No apps navigation changed
*/
+ #[ApiRoute(verb: 'GET', url: '/navigation/apps', root: '/core')]
public function getAppsNavigation(bool $absolute = false): DataResponse {
$navigation = $this->navigationManager->getAll();
if ($absolute) {
@@ -83,6 +85,7 @@ public function getAppsNavigation(bool $absolute = false): DataResponse {
* 200: Apps navigation returned
* 304: No apps navigation changed
*/
+ #[ApiRoute(verb: 'GET', url: '/navigation/settings', root: '/core')]
public function getSettingsNavigation(bool $absolute = false): DataResponse {
$navigation = $this->navigationManager->getAll('settings');
if ($absolute) {
diff --git a/core/Controller/OCJSController.php b/core/Controller/OCJSController.php
index e909343912574..dbb203e827f34 100644
--- a/core/Controller/OCJSController.php
+++ b/core/Controller/OCJSController.php
@@ -34,6 +34,7 @@
use OCP\App\IAppManager;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http;
+use OCP\AppFramework\Http\Attribute\FrontpageRoute;
use OCP\AppFramework\Http\Attribute\OpenAPI;
use OCP\AppFramework\Http\DataDisplayResponse;
use OCP\Defaults;
@@ -87,6 +88,7 @@ public function __construct(
* @NoTwoFactorRequired
* @PublicPage
*/
+ #[FrontpageRoute(verb: 'GET', url: '/core/js/oc.js')]
public function getConfig(): DataDisplayResponse {
$data = $this->helper->getConfig();
diff --git a/core/Controller/OCMController.php b/core/Controller/OCMController.php
index 03a8c0d8e4f26..4fa03e67c4f23 100644
--- a/core/Controller/OCMController.php
+++ b/core/Controller/OCMController.php
@@ -29,6 +29,7 @@
use Exception;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http;
+use OCP\AppFramework\Http\Attribute\FrontpageRoute;
use OCP\AppFramework\Http\DataResponse;
use OCP\Capabilities\ICapability;
use OCP\IConfig;
@@ -64,6 +65,7 @@ public function __construct(
* 200: OCM Provider details returned
* 500: OCM not supported
*/
+ #[FrontpageRoute(verb: 'GET', url: '/ocm-provider/')]
public function discovery(): DataResponse {
try {
$cap = Server::get(
diff --git a/core/Controller/OCSController.php b/core/Controller/OCSController.php
index b0ab867f8d8e5..c6ddc23717d17 100644
--- a/core/Controller/OCSController.php
+++ b/core/Controller/OCSController.php
@@ -31,6 +31,7 @@
use OC\CapabilitiesManager;
use OC\Security\IdentityProof\Manager;
use OCP\AppFramework\Http;
+use OCP\AppFramework\Http\Attribute\ApiRoute;
use OCP\AppFramework\Http\Attribute\OpenAPI;
use OCP\AppFramework\Http\DataResponse;
use OCP\IRequest;
@@ -53,6 +54,7 @@ public function __construct(
* @PublicPage
*/
#[OpenAPI(scope: OpenAPI::SCOPE_IGNORE)]
+ #[ApiRoute(verb: 'GET', url: '/config', root: '')]
public function getConfig(): DataResponse {
$data = [
'version' => '1.7',
@@ -74,6 +76,7 @@ public function getConfig(): DataResponse {
*
* 200: Capabilities returned
*/
+ #[ApiRoute(verb: 'GET', url: '/capabilities', root: '/cloud')]
public function getCapabilities(): DataResponse {
$result = [];
[$major, $minor, $micro] = \OCP\Util::getVersion();
@@ -102,6 +105,7 @@ public function getCapabilities(): DataResponse {
* @BruteForceProtection(action=login)
*/
#[OpenAPI(scope: OpenAPI::SCOPE_IGNORE)]
+ #[ApiRoute(verb: 'POST', url: '/check', root: '/person')]
public function personCheck(string $login = '', string $password = ''): DataResponse {
if ($login !== '' && $password !== '') {
if ($this->userManager->checkPassword($login, $password)) {
@@ -123,6 +127,7 @@ public function personCheck(string $login = '', string $password = ''): DataResp
* @PublicPage
*/
#[OpenAPI(scope: OpenAPI::SCOPE_IGNORE)]
+ #[ApiRoute(verb: 'GET', url: '/key/{cloudId}', root: '/identityproof')]
public function getIdentityProof(string $cloudId): DataResponse {
$userObject = $this->userManager->get($cloudId);
diff --git a/core/Controller/PreviewController.php b/core/Controller/PreviewController.php
index 7adec03814c7d..34c21bd3ecb9e 100644
--- a/core/Controller/PreviewController.php
+++ b/core/Controller/PreviewController.php
@@ -30,6 +30,7 @@
use OCA\Files_Sharing\SharedStorage;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http;
+use OCP\AppFramework\Http\Attribute\FrontpageRoute;
use OCP\AppFramework\Http\DataResponse;
use OCP\AppFramework\Http\FileDisplayResponse;
use OCP\AppFramework\Http\RedirectResponse;
@@ -74,6 +75,7 @@ public function __construct(
* 403: Getting preview is not allowed
* 404: Preview not found
*/
+ #[FrontpageRoute(verb: 'GET', url: '/core/preview.png')]
public function getPreview(
string $file = '',
int $x = 32,
@@ -117,6 +119,7 @@ public function getPreview(
* 403: Getting preview is not allowed
* 404: Preview not found
*/
+ #[FrontpageRoute(verb: 'GET', url: '/core/preview')]
public function getPreviewByFileId(
int $fileId = -1,
int $x = 32,
diff --git a/core/Controller/ProfileApiController.php b/core/Controller/ProfileApiController.php
index 7a11e5f93c18e..7cba0593c1f81 100644
--- a/core/Controller/ProfileApiController.php
+++ b/core/Controller/ProfileApiController.php
@@ -30,6 +30,7 @@
use OC\Core\Db\ProfileConfigMapper;
use OC\Profile\ProfileManager;
use OCP\AppFramework\Http;
+use OCP\AppFramework\Http\Attribute\ApiRoute;
use OCP\AppFramework\Http\DataResponse;
use OCP\AppFramework\OCS\OCSBadRequestException;
use OCP\AppFramework\OCS\OCSForbiddenException;
@@ -68,6 +69,7 @@ public function __construct(
*
* 200: Visibility updated successfully
*/
+ #[ApiRoute(verb: 'PUT', url: '/{targetUserId}', root: '/profile')]
public function setVisibility(string $targetUserId, string $paramId, string $visibility): DataResponse {
$requestingUser = $this->userSession->getUser();
$targetUser = $this->userManager->get($targetUserId);
diff --git a/core/Controller/ProfilePageController.php b/core/Controller/ProfilePageController.php
index eb5b0aa4c0aee..c3a33d6bbdae9 100644
--- a/core/Controller/ProfilePageController.php
+++ b/core/Controller/ProfilePageController.php
@@ -29,6 +29,7 @@
use OC\Profile\ProfileManager;
use OCP\AppFramework\Controller;
+use OCP\AppFramework\Http\Attribute\FrontpageRoute;
use OCP\AppFramework\Http\Attribute\OpenAPI;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\AppFramework\Services\IInitialState;
@@ -65,6 +66,7 @@ public function __construct(
* @NoAdminRequired
* @NoSubAdminRequired
*/
+ #[FrontpageRoute(verb: 'GET', url: '/u/{targetUserId}')]
public function index(string $targetUserId): TemplateResponse {
$profileNotFoundTemplate = new TemplateResponse(
'core',
diff --git a/core/Controller/RecommendedAppsController.php b/core/Controller/RecommendedAppsController.php
index 59e40f56f730d..5d4749e1e8374 100644
--- a/core/Controller/RecommendedAppsController.php
+++ b/core/Controller/RecommendedAppsController.php
@@ -27,6 +27,7 @@
namespace OC\Core\Controller;
use OCP\AppFramework\Controller;
+use OCP\AppFramework\Http\Attribute\FrontpageRoute;
use OCP\AppFramework\Http\Attribute\OpenAPI;
use OCP\AppFramework\Http\Response;
use OCP\AppFramework\Http\StandaloneTemplateResponse;
@@ -48,6 +49,7 @@ public function __construct(
* @NoCSRFRequired
* @return Response
*/
+ #[FrontpageRoute(verb: 'GET', url: '/core/apps/recommended')]
public function index(): Response {
$defaultPageUrl = $this->urlGenerator->linkToDefaultPageUrl();
$this->initialStateService->provideInitialState('core', 'defaultPageUrl', $defaultPageUrl);
diff --git a/core/Controller/ReferenceApiController.php b/core/Controller/ReferenceApiController.php
index 384011f80208f..854c15cb98549 100644
--- a/core/Controller/ReferenceApiController.php
+++ b/core/Controller/ReferenceApiController.php
@@ -27,6 +27,7 @@
use OCA\Core\ResponseDefinitions;
use OCP\AppFramework\Http;
+use OCP\AppFramework\Http\Attribute\ApiRoute;
use OCP\AppFramework\Http\DataResponse;
use OCP\Collaboration\Reference\IDiscoverableReferenceProvider;
use OCP\Collaboration\Reference\IReferenceManager;
@@ -59,6 +60,7 @@ public function __construct(
*
* 200: References returned
*/
+ #[ApiRoute(verb: 'POST', url: '/extract', root: '/references')]
public function extract(string $text, bool $resolve = false, int $limit = 1): DataResponse {
$references = $this->referenceManager->extractReferences($text);
@@ -87,6 +89,7 @@ public function extract(string $text, bool $resolve = false, int $limit = 1): Da
*
* 200: Reference returned
*/
+ #[ApiRoute(verb: 'GET', url: '/resolve', root: '/references')]
public function resolveOne(string $reference): DataResponse {
/** @var ?CoreReference $resolvedReference */
$resolvedReference = $this->referenceManager->resolveReference(trim($reference))?->jsonSerialize();
@@ -107,6 +110,7 @@ public function resolveOne(string $reference): DataResponse {
*
* 200: References returned
*/
+ #[ApiRoute(verb: 'POST', url: '/resolve', root: '/references')]
public function resolve(array $references, int $limit = 1): DataResponse {
$result = [];
$index = 0;
@@ -132,6 +136,7 @@ public function resolve(array $references, int $limit = 1): DataResponse {
*
* 200: Providers returned
*/
+ #[ApiRoute(verb: 'GET', url: '/providers', root: '/references')]
public function getProvidersInfo(): DataResponse {
$providers = $this->referenceManager->getDiscoverableProviders();
$jsonProviders = array_map(static function (IDiscoverableReferenceProvider $provider) {
@@ -151,6 +156,7 @@ public function getProvidersInfo(): DataResponse {
*
* 200: Provider touched
*/
+ #[ApiRoute(verb: 'PUT', url: '/provider/{providerId}', root: '/references')]
public function touchProvider(string $providerId, ?int $timestamp = null): DataResponse {
if ($this->userId !== null) {
$success = $this->referenceManager->touchProvider($this->userId, $providerId, $timestamp);
diff --git a/core/Controller/ReferenceController.php b/core/Controller/ReferenceController.php
index 8d1ff7f86d290..8874978037fa1 100644
--- a/core/Controller/ReferenceController.php
+++ b/core/Controller/ReferenceController.php
@@ -27,6 +27,7 @@
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http;
+use OCP\AppFramework\Http\Attribute\FrontpageRoute;
use OCP\AppFramework\Http\DataDownloadResponse;
use OCP\AppFramework\Http\DataResponse;
use OCP\Collaboration\Reference\IReferenceManager;
@@ -57,6 +58,7 @@ public function __construct(
* 200: Preview returned
* 404: Reference not found
*/
+ #[FrontpageRoute(verb: 'GET', url: '/core/references/preview/{referenceId}')]
public function preview(string $referenceId): DataDownloadResponse|DataResponse {
$reference = $this->referenceManager->getReferenceByCacheKey($referenceId);
diff --git a/core/Controller/SearchController.php b/core/Controller/SearchController.php
index f839c16e8dac5..ccea067ae2cf8 100644
--- a/core/Controller/SearchController.php
+++ b/core/Controller/SearchController.php
@@ -27,6 +27,7 @@
namespace OC\Core\Controller;
use OCP\AppFramework\Controller;
+use OCP\AppFramework\Http\Attribute\FrontpageRoute;
use OCP\AppFramework\Http\JSONResponse;
use OCP\IRequest;
use OCP\ISearch;
@@ -46,6 +47,7 @@ public function __construct(
/**
* @NoAdminRequired
*/
+ #[FrontpageRoute(verb: 'GET', url: '/core/search')]
public function search(string $query, array $inApps = [], int $page = 1, int $size = 30): JSONResponse {
$results = $this->searcher->searchPaged($query, $inApps, $page, $size);
diff --git a/core/Controller/TextProcessingApiController.php b/core/Controller/TextProcessingApiController.php
index cbba7e976b0d5..6ba98f99f51d0 100644
--- a/core/Controller/TextProcessingApiController.php
+++ b/core/Controller/TextProcessingApiController.php
@@ -30,6 +30,7 @@
use OCA\Core\ResponseDefinitions;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\Attribute\AnonRateLimit;
+use OCP\AppFramework\Http\Attribute\ApiRoute;
use OCP\AppFramework\Http\Attribute\NoAdminRequired;
use OCP\AppFramework\Http\Attribute\PublicPage;
use OCP\AppFramework\Http\Attribute\UserRateLimit;
@@ -72,6 +73,7 @@ public function __construct(
* 200: Task types returned
*/
#[PublicPage]
+ #[ApiRoute(verb: 'GET', url: '/tasktypes', root: '/textprocessing')]
public function taskTypes(): DataResponse {
$typeClasses = $this->textProcessingManager->getAvailableTaskTypes();
$types = [];
@@ -113,6 +115,7 @@ public function taskTypes(): DataResponse {
#[PublicPage]
#[UserRateLimit(limit: 20, period: 120)]
#[AnonRateLimit(limit: 5, period: 120)]
+ #[ApiRoute(verb: 'POST', url: '/schedule', root: '/textprocessing')]
public function schedule(string $input, string $type, string $appId, string $identifier = ''): DataResponse {
try {
$task = new Task($type, $input, $appId, $this->userId, $identifier);
@@ -150,6 +153,7 @@ public function schedule(string $input, string $type, string $appId, string $ide
* 404: Task not found
*/
#[PublicPage]
+ #[ApiRoute(verb: 'GET', url: '/task/{id}', root: '/textprocessing')]
public function getTask(int $id): DataResponse {
try {
$task = $this->textProcessingManager->getUserTask($id, $this->userId);
@@ -177,6 +181,7 @@ public function getTask(int $id): DataResponse {
* 404: Task not found
*/
#[NoAdminRequired]
+ #[ApiRoute(verb: 'DELETE', url: '/task/{id}', root: '/textprocessing')]
public function deleteTask(int $id): DataResponse {
try {
$task = $this->textProcessingManager->getUserTask($id, $this->userId);
@@ -207,6 +212,7 @@ public function deleteTask(int $id): DataResponse {
* 200: Task list returned
*/
#[NoAdminRequired]
+ #[ApiRoute(verb: 'GET', url: '/tasks/app/{appId}', root: '/textprocessing')]
public function listTasksByApp(string $appId, ?string $identifier = null): DataResponse {
try {
$tasks = $this->textProcessingManager->getUserTasksByApp($this->userId, $appId, $identifier);
diff --git a/core/Controller/TextToImageApiController.php b/core/Controller/TextToImageApiController.php
index 9d97a53875061..8dd21e9066467 100644
--- a/core/Controller/TextToImageApiController.php
+++ b/core/Controller/TextToImageApiController.php
@@ -30,6 +30,7 @@
use OCA\Core\ResponseDefinitions;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\Attribute\AnonRateLimit;
+use OCP\AppFramework\Http\Attribute\ApiRoute;
use OCP\AppFramework\Http\Attribute\BruteForceProtection;
use OCP\AppFramework\Http\Attribute\NoAdminRequired;
use OCP\AppFramework\Http\Attribute\PublicPage;
@@ -69,6 +70,7 @@ public function __construct(
* 200: Returns availability status
*/
#[PublicPage]
+ #[ApiRoute(verb: 'GET', url: '/is_available', root: '/text2image')]
public function isAvailable(): DataResponse {
return new DataResponse([
'isAvailable' => $this->textToImageManager->hasProviders(),
@@ -91,6 +93,7 @@ public function isAvailable(): DataResponse {
#[PublicPage]
#[UserRateLimit(limit: 20, period: 120)]
#[AnonRateLimit(limit: 5, period: 120)]
+ #[ApiRoute(verb: 'POST', url: '/schedule', root: '/text2image')]
public function schedule(string $input, string $appId, string $identifier = '', int $numberOfImages = 8): DataResponse {
$task = new Task($input, $appId, $numberOfImages, $this->userId, $identifier);
try {
@@ -125,6 +128,7 @@ public function schedule(string $input, string $appId, string $identifier = '',
*/
#[PublicPage]
#[BruteForceProtection(action: 'text2image')]
+ #[ApiRoute(verb: 'GET', url: '/task/{id}', root: '/text2image')]
public function getTask(int $id): DataResponse {
try {
$task = $this->textToImageManager->getUserTask($id, $this->userId);
@@ -156,6 +160,7 @@ public function getTask(int $id): DataResponse {
*/
#[PublicPage]
#[BruteForceProtection(action: 'text2image')]
+ #[ApiRoute(verb: 'GET', url: '/task/{id}/image/{index}', root: '/text2image')]
public function getImage(int $id, int $index): DataResponse|FileDisplayResponse {
try {
$task = $this->textToImageManager->getUserTask($id, $this->userId);
@@ -195,6 +200,7 @@ public function getImage(int $id, int $index): DataResponse|FileDisplayResponse
*/
#[NoAdminRequired]
#[BruteForceProtection(action: 'text2image')]
+ #[ApiRoute(verb: 'DELETE', url: '/task/{id}', root: '/text2image')]
public function deleteTask(int $id): DataResponse {
try {
$task = $this->textToImageManager->getUserTask($id, $this->userId);
@@ -228,6 +234,7 @@ public function deleteTask(int $id): DataResponse {
*/
#[NoAdminRequired]
#[AnonRateLimit(limit: 5, period: 120)]
+ #[ApiRoute(verb: 'GET', url: '/tasks/app/{appId}', root: '/text2image')]
public function listTasksByApp(string $appId, ?string $identifier = null): DataResponse {
try {
$tasks = $this->textToImageManager->getUserTasksByApp($this->userId, $appId, $identifier);
diff --git a/core/Controller/TranslationApiController.php b/core/Controller/TranslationApiController.php
index c4f3c8e855eea..4cc0ec95ca19c 100644
--- a/core/Controller/TranslationApiController.php
+++ b/core/Controller/TranslationApiController.php
@@ -29,6 +29,7 @@
use InvalidArgumentException;
use OCP\AppFramework\Http;
+use OCP\AppFramework\Http\Attribute\ApiRoute;
use OCP\AppFramework\Http\DataResponse;
use OCP\IL10N;
use OCP\IRequest;
@@ -55,6 +56,7 @@ public function __construct(
*
* 200: Supported languages returned
*/
+ #[ApiRoute(verb: 'GET', url: '/languages', root: '/translation')]
public function languages(): DataResponse {
return new DataResponse([
'languages' => array_map(fn ($lang) => $lang->jsonSerialize(), $this->translationManager->getLanguages()),
@@ -78,6 +80,7 @@ public function languages(): DataResponse {
* 400: Language not detected or unable to translate
* 412: Translating is not possible
*/
+ #[ApiRoute(verb: 'POST', url: '/translate', root: '/translation')]
public function translate(string $text, ?string $fromLanguage, string $toLanguage): DataResponse {
try {
$translation = $this->translationManager->translate($text, $fromLanguage, $toLanguage);
diff --git a/core/Controller/TwoFactorChallengeController.php b/core/Controller/TwoFactorChallengeController.php
index bc25121034b9a..7152078c3381a 100644
--- a/core/Controller/TwoFactorChallengeController.php
+++ b/core/Controller/TwoFactorChallengeController.php
@@ -29,6 +29,7 @@
use OC\Authentication\TwoFactorAuth\Manager;
use OC_User;
use OCP\AppFramework\Controller;
+use OCP\AppFramework\Http\Attribute\FrontpageRoute;
use OCP\AppFramework\Http\Attribute\OpenAPI;
use OCP\AppFramework\Http\Attribute\UseSession;
use OCP\AppFramework\Http\RedirectResponse;
@@ -89,6 +90,7 @@ private function splitProvidersAndBackupCodes(array $providers): array {
* @param string $redirect_url
* @return StandaloneTemplateResponse
*/
+ #[FrontpageRoute(verb: 'GET', url: '/login/selectchallenge')]
public function selectChallenge($redirect_url) {
$user = $this->userSession->getUser();
$providerSet = $this->twoFactorManager->getProviderSet($user);
@@ -117,6 +119,7 @@ public function selectChallenge($redirect_url) {
* @return StandaloneTemplateResponse|RedirectResponse
*/
#[UseSession]
+ #[FrontpageRoute(verb: 'GET', url: '/login/challenge/{challengeProviderId}')]
public function showChallenge($challengeProviderId, $redirect_url) {
$user = $this->userSession->getUser();
$providerSet = $this->twoFactorManager->getProviderSet($user);
@@ -171,6 +174,7 @@ public function showChallenge($challengeProviderId, $redirect_url) {
* @return RedirectResponse
*/
#[UseSession]
+ #[FrontpageRoute(verb: 'POST', url: '/login/challenge/{challengeProviderId}')]
public function solveChallenge($challengeProviderId, $challenge, $redirect_url = null) {
$user = $this->userSession->getUser();
$provider = $this->twoFactorManager->getProvider($user, $challengeProviderId);
@@ -208,6 +212,7 @@ public function solveChallenge($challengeProviderId, $challenge, $redirect_url =
* @NoAdminRequired
* @NoCSRFRequired
*/
+ #[FrontpageRoute(verb: 'GET', url: 'login/setupchallenge')]
public function setupProviders(): StandaloneTemplateResponse {
$user = $this->userSession->getUser();
$setupProviders = $this->twoFactorManager->getLoginSetupProviders($user);
@@ -224,6 +229,7 @@ public function setupProviders(): StandaloneTemplateResponse {
* @NoAdminRequired
* @NoCSRFRequired
*/
+ #[FrontpageRoute(verb: 'GET', url: 'login/setupchallenge/{providerId}')]
public function setupProvider(string $providerId) {
$user = $this->userSession->getUser();
$providers = $this->twoFactorManager->getLoginSetupProviders($user);
@@ -257,6 +263,7 @@ public function setupProvider(string $providerId) {
*
* @todo handle the extreme edge case of an invalid provider ID and redirect to the provider selection page
*/
+ #[FrontpageRoute(verb: 'POST', url: 'login/setupchallenge/{providerId}')]
public function confirmProviderSetup(string $providerId) {
return new RedirectResponse($this->urlGenerator->linkToRoute(
'core.TwoFactorChallenge.showChallenge',
diff --git a/core/Controller/UnifiedSearchController.php b/core/Controller/UnifiedSearchController.php
index 9754515603c74..469c6c6ed7bf4 100644
--- a/core/Controller/UnifiedSearchController.php
+++ b/core/Controller/UnifiedSearchController.php
@@ -34,6 +34,7 @@
use OC\Search\UnsupportedFilter;
use OCA\Core\ResponseDefinitions;
use OCP\AppFramework\Http;
+use OCP\AppFramework\Http\Attribute\ApiRoute;
use OCP\AppFramework\Http\DataResponse;
use OCP\AppFramework\OCSController;
use OCP\IRequest;
@@ -69,6 +70,7 @@ public function __construct(
*
* 200: Providers returned
*/
+ #[ApiRoute(verb: 'GET', url: '/providers', root: '/search')]
public function getProviders(string $from = ''): DataResponse {
[$route, $parameters] = $this->getRouteInformation($from);
@@ -99,6 +101,7 @@ public function getProviders(string $from = ''): DataResponse {
* 200: Search entries returned
* 400: Searching is not possible
*/
+ #[ApiRoute(verb: 'GET', url: '/providers/{providerId}/search', root: '/search')]
public function search(
string $providerId,
// Unused parameter for OpenAPI spec generator
diff --git a/core/Controller/UnsupportedBrowserController.php b/core/Controller/UnsupportedBrowserController.php
index 4f096d4409226..dfcff8df38140 100644
--- a/core/Controller/UnsupportedBrowserController.php
+++ b/core/Controller/UnsupportedBrowserController.php
@@ -28,6 +28,7 @@
namespace OC\Core\Controller;
use OCP\AppFramework\Controller;
+use OCP\AppFramework\Http\Attribute\FrontpageRoute;
use OCP\AppFramework\Http\Attribute\OpenAPI;
use OCP\AppFramework\Http\Response;
use OCP\AppFramework\Http\TemplateResponse;
@@ -46,6 +47,7 @@ public function __construct(IRequest $request) {
*
* @return Response
*/
+ #[FrontpageRoute(verb: 'GET', url: 'unsupported')]
public function index(): Response {
Util::addScript('core', 'unsupported-browser');
Util::addStyle('core', 'icons');
diff --git a/core/Controller/UserController.php b/core/Controller/UserController.php
index f8dbc1af02700..c941a80e53df6 100644
--- a/core/Controller/UserController.php
+++ b/core/Controller/UserController.php
@@ -25,6 +25,7 @@
namespace OC\Core\Controller;
use OCP\AppFramework\Controller;
+use OCP\AppFramework\Http\Attribute\FrontpageRoute;
use OCP\AppFramework\Http\JSONResponse;
use OCP\IRequest;
use OCP\IUserManager;
@@ -47,6 +48,7 @@ public function __construct(
*
* @return JSONResponse
*/
+ #[FrontpageRoute(verb: 'POST', url: '/displaynames')]
public function getDisplayNames($users) {
$result = [];
diff --git a/core/Controller/WalledGardenController.php b/core/Controller/WalledGardenController.php
index 2ae91135b1dc1..e5d8edd9083e5 100644
--- a/core/Controller/WalledGardenController.php
+++ b/core/Controller/WalledGardenController.php
@@ -26,6 +26,7 @@
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http;
+use OCP\AppFramework\Http\Attribute\FrontpageRoute;
use OCP\AppFramework\Http\Attribute\OpenAPI;
use OCP\AppFramework\Http\Response;
@@ -35,6 +36,7 @@ class WalledGardenController extends Controller {
* @PublicPage
* @NoCSRFRequired
*/
+ #[FrontpageRoute(verb: 'GET', url: '/204')]
public function get(): Response {
$resp = new Response();
$resp->setStatus(Http::STATUS_NO_CONTENT);
diff --git a/core/Controller/WebAuthnController.php b/core/Controller/WebAuthnController.php
index 08a6b36d276f3..70034f08fcc5e 100644
--- a/core/Controller/WebAuthnController.php
+++ b/core/Controller/WebAuthnController.php
@@ -33,6 +33,7 @@
use OC\URLGenerator;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http;
+use OCP\AppFramework\Http\Attribute\FrontpageRoute;
use OCP\AppFramework\Http\Attribute\UseSession;
use OCP\AppFramework\Http\JSONResponse;
use OCP\IRequest;
@@ -62,6 +63,7 @@ public function __construct(
* @PublicPage
*/
#[UseSession]
+ #[FrontpageRoute(verb: 'POST', url: 'login/webauthn/start')]
public function startAuthentication(string $loginName): JSONResponse {
$this->logger->debug('Starting WebAuthn login');
@@ -86,6 +88,7 @@ public function startAuthentication(string $loginName): JSONResponse {
* @PublicPage
*/
#[UseSession]
+ #[FrontpageRoute(verb: 'POST', url: 'login/webauthn/finish')]
public function finishAuthentication(string $data): JSONResponse {
$this->logger->debug('Validating WebAuthn login');
diff --git a/core/Controller/WellKnownController.php b/core/Controller/WellKnownController.php
index 896d216308d98..0e6b7ee3ef8c6 100644
--- a/core/Controller/WellKnownController.php
+++ b/core/Controller/WellKnownController.php
@@ -29,6 +29,7 @@
use OC\Http\WellKnown\RequestManager;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http;
+use OCP\AppFramework\Http\Attribute\FrontpageRoute;
use OCP\AppFramework\Http\Attribute\OpenAPI;
use OCP\AppFramework\Http\JSONResponse;
use OCP\AppFramework\Http\Response;
@@ -49,6 +50,7 @@ public function __construct(
*
* @return Response
*/
+ #[FrontpageRoute(verb: 'GET', url: '.well-known/{service}')]
public function handle(string $service): Response {
$response = $this->requestManager->process(
$service,
diff --git a/core/Controller/WhatsNewController.php b/core/Controller/WhatsNewController.php
index 2d48f3cc485e7..ab107cd115d12 100644
--- a/core/Controller/WhatsNewController.php
+++ b/core/Controller/WhatsNewController.php
@@ -29,6 +29,7 @@
use OC\Updater\ChangesCheck;
use OCP\AppFramework\Db\DoesNotExistException;
use OCP\AppFramework\Http;
+use OCP\AppFramework\Http\Attribute\ApiRoute;
use OCP\AppFramework\Http\DataResponse;
use OCP\Defaults;
use OCP\IConfig;
@@ -63,6 +64,7 @@ public function __construct(
* 200: Changes returned
* 204: No changes
*/
+ #[ApiRoute(verb: 'GET', url: '/whatsnew', root: '/core')]
public function get():DataResponse {
$user = $this->userSession->getUser();
if ($user === null) {
@@ -110,6 +112,7 @@ public function get():DataResponse {
*
* 200: Changes dismissed
*/
+ #[ApiRoute(verb: 'POST', url: '/whatsnew', root: '/core')]
public function dismiss(string $version):DataResponse {
$user = $this->userSession->getUser();
if ($user === null) {
diff --git a/core/Controller/WipeController.php b/core/Controller/WipeController.php
index c18b74e4b9618..3e4860036681b 100644
--- a/core/Controller/WipeController.php
+++ b/core/Controller/WipeController.php
@@ -29,6 +29,7 @@
use OC\Authentication\Token\RemoteWipe;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http;
+use OCP\AppFramework\Http\Attribute\FrontpageRoute;
use OCP\AppFramework\Http\JSONResponse;
use OCP\Authentication\Exceptions\InvalidTokenException;
use OCP\IRequest;
@@ -58,6 +59,7 @@ public function __construct(
* 200: Device should be wiped
* 404: Device should not be wiped
*/
+ #[FrontpageRoute(verb: 'POST', url: '/core/wipe/check')]
public function checkWipe(string $token): JSONResponse {
try {
if ($this->remoteWipe->start($token)) {
@@ -89,6 +91,7 @@ public function checkWipe(string $token): JSONResponse {
* 200: Wipe finished successfully
* 404: Device should not be wiped
*/
+ #[FrontpageRoute(verb: 'POST', url: '/core/wipe/success')]
public function wipeDone(string $token): JSONResponse {
try {
if ($this->remoteWipe->finish($token)) {
diff --git a/core/openapi.json b/core/openapi.json
index 5a33f547a923e..2c6b5f28ef247 100644
--- a/core/openapi.json
+++ b/core/openapi.json
@@ -639,15 +639,14 @@
}
},
"paths": {
- "/index.php/avatar/{userId}/{size}/dark": {
+ "/ocs/v2.php/core/getapppassword": {
"get": {
- "operationId": "avatar-get-avatar-dark",
- "summary": "Get the dark avatar",
+ "operationId": "app_password-get-app-password",
+ "summary": "Create app password",
"tags": [
- "avatar"
+ "app_password"
],
"security": [
- {},
{
"bearer_auth": []
},
@@ -657,65 +656,76 @@
],
"parameters": [
{
- "name": "userId",
- "in": "path",
- "description": "ID of the user",
- "required": true,
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "size",
- "in": "path",
- "description": "Size of the avatar",
+ "name": "OCS-APIRequest",
+ "in": "header",
+ "description": "Required to be true for the API request to pass",
"required": true,
"schema": {
- "type": "integer",
- "format": "int64"
+ "type": "boolean",
+ "default": true
}
}
],
"responses": {
"200": {
- "description": "Avatar returned",
- "headers": {
- "X-NC-IsCustomAvatar": {
- "schema": {
- "type": "integer",
- "format": "int64"
- }
- }
- },
+ "description": "App password returned",
"content": {
- "*/*": {
+ "application/json": {
"schema": {
- "type": "string",
- "format": "binary"
+ "type": "object",
+ "required": [
+ "ocs"
+ ],
+ "properties": {
+ "ocs": {
+ "type": "object",
+ "required": [
+ "meta",
+ "data"
+ ],
+ "properties": {
+ "meta": {
+ "$ref": "#/components/schemas/OCSMeta"
+ },
+ "data": {
+ "type": "object",
+ "required": [
+ "apppassword"
+ ],
+ "properties": {
+ "apppassword": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+ }
}
}
}
},
- "404": {
- "description": "Avatar not found",
+ "403": {
+ "description": "Creating app password is not allowed",
"content": {
- "application/json": {
- "schema": {}
+ "text/plain": {
+ "schema": {
+ "type": "string"
+ }
}
}
}
}
}
},
- "/index.php/avatar/{userId}/{size}": {
- "get": {
- "operationId": "avatar-get-avatar",
- "summary": "Get the avatar",
+ "/ocs/v2.php/core/apppassword": {
+ "delete": {
+ "operationId": "app_password-delete-app-password",
+ "summary": "Delete app password",
"tags": [
- "avatar"
+ "app_password"
],
"security": [
- {},
{
"bearer_auth": []
},
@@ -725,65 +735,66 @@
],
"parameters": [
{
- "name": "userId",
- "in": "path",
- "description": "ID of the user",
- "required": true,
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "size",
- "in": "path",
- "description": "Size of the avatar",
+ "name": "OCS-APIRequest",
+ "in": "header",
+ "description": "Required to be true for the API request to pass",
"required": true,
"schema": {
- "type": "integer",
- "format": "int64"
+ "type": "boolean",
+ "default": true
}
}
],
"responses": {
"200": {
- "description": "Avatar returned",
- "headers": {
- "X-NC-IsCustomAvatar": {
- "schema": {
- "type": "integer",
- "format": "int64"
- }
- }
- },
+ "description": "App password deleted successfully",
"content": {
- "*/*": {
+ "application/json": {
"schema": {
- "type": "string",
- "format": "binary"
+ "type": "object",
+ "required": [
+ "ocs"
+ ],
+ "properties": {
+ "ocs": {
+ "type": "object",
+ "required": [
+ "meta",
+ "data"
+ ],
+ "properties": {
+ "meta": {
+ "$ref": "#/components/schemas/OCSMeta"
+ },
+ "data": {}
+ }
+ }
+ }
}
}
}
},
- "404": {
- "description": "Avatar not found",
+ "403": {
+ "description": "Deleting app password is not allowed",
"content": {
- "application/json": {
- "schema": {}
+ "text/plain": {
+ "schema": {
+ "type": "string"
+ }
}
}
}
}
}
},
- "/index.php/avatar/guest/{guestName}/{size}/dark": {
- "get": {
- "operationId": "guest_avatar-get-avatar-dark",
- "summary": "Returns a dark guest avatar image response",
+ "/ocs/v2.php/core/apppassword/rotate": {
+ "post": {
+ "operationId": "app_password-rotate-app-password",
+ "summary": "Rotate app password",
"tags": [
- "guest_avatar"
+ "app_password"
],
"security": [
- {},
{
"bearer_auth": []
},
@@ -793,62 +804,76 @@
],
"parameters": [
{
- "name": "guestName",
- "in": "path",
- "description": "The guest name, e.g. \"Albert\"",
- "required": true,
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "size",
- "in": "path",
- "description": "The desired avatar size, e.g. 64 for 64x64px",
+ "name": "OCS-APIRequest",
+ "in": "header",
+ "description": "Required to be true for the API request to pass",
"required": true,
"schema": {
- "type": "string"
+ "type": "boolean",
+ "default": true
}
}
],
"responses": {
"200": {
- "description": "Custom avatar returned",
+ "description": "App password returned",
"content": {
- "*/*": {
+ "application/json": {
"schema": {
- "type": "string",
- "format": "binary"
+ "type": "object",
+ "required": [
+ "ocs"
+ ],
+ "properties": {
+ "ocs": {
+ "type": "object",
+ "required": [
+ "meta",
+ "data"
+ ],
+ "properties": {
+ "meta": {
+ "$ref": "#/components/schemas/OCSMeta"
+ },
+ "data": {
+ "type": "object",
+ "required": [
+ "apppassword"
+ ],
+ "properties": {
+ "apppassword": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+ }
}
}
}
},
- "201": {
- "description": "Avatar returned",
+ "403": {
+ "description": "Rotating app password is not allowed",
"content": {
- "*/*": {
+ "text/plain": {
"schema": {
- "type": "string",
- "format": "binary"
+ "type": "string"
}
}
}
- },
- "500": {
- "description": ""
}
}
}
},
- "/index.php/avatar/guest/{guestName}/{size}": {
- "get": {
- "operationId": "guest_avatar-get-avatar",
- "summary": "Returns a guest avatar image response",
+ "/ocs/v2.php/core/apppassword/confirm": {
+ "put": {
+ "operationId": "app_password-confirm-user-password",
+ "summary": "Confirm the user password",
"tags": [
- "guest_avatar"
+ "app_password"
],
"security": [
- {},
{
"bearer_auth": []
},
@@ -858,73 +883,102 @@
],
"parameters": [
{
- "name": "darkTheme",
+ "name": "password",
"in": "query",
- "description": "Return dark avatar",
+ "description": "The password of the user",
+ "required": true,
"schema": {
- "type": "integer",
- "nullable": true,
- "default": 0,
- "enum": [
- 0,
- 1
- ]
+ "type": "string"
}
},
{
- "name": "guestName",
- "in": "path",
- "description": "The guest name, e.g. \"Albert\"",
- "required": true,
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "size",
- "in": "path",
- "description": "The desired avatar size, e.g. 64 for 64x64px",
+ "name": "OCS-APIRequest",
+ "in": "header",
+ "description": "Required to be true for the API request to pass",
"required": true,
"schema": {
- "type": "string"
+ "type": "boolean",
+ "default": true
}
}
],
"responses": {
"200": {
- "description": "Custom avatar returned",
+ "description": "Password confirmation succeeded",
"content": {
- "*/*": {
+ "application/json": {
"schema": {
- "type": "string",
- "format": "binary"
+ "type": "object",
+ "required": [
+ "ocs"
+ ],
+ "properties": {
+ "ocs": {
+ "type": "object",
+ "required": [
+ "meta",
+ "data"
+ ],
+ "properties": {
+ "meta": {
+ "$ref": "#/components/schemas/OCSMeta"
+ },
+ "data": {
+ "type": "object",
+ "required": [
+ "lastLogin"
+ ],
+ "properties": {
+ "lastLogin": {
+ "type": "integer",
+ "format": "int64"
+ }
+ }
+ }
+ }
+ }
+ }
}
}
}
},
- "201": {
- "description": "Avatar returned",
+ "403": {
+ "description": "Password confirmation failed",
"content": {
- "*/*": {
+ "application/json": {
"schema": {
- "type": "string",
- "format": "binary"
+ "type": "object",
+ "required": [
+ "ocs"
+ ],
+ "properties": {
+ "ocs": {
+ "type": "object",
+ "required": [
+ "meta",
+ "data"
+ ],
+ "properties": {
+ "meta": {
+ "$ref": "#/components/schemas/OCSMeta"
+ },
+ "data": {}
+ }
+ }
+ }
}
}
}
- },
- "500": {
- "description": ""
}
}
}
},
- "/index.php/login/confirm": {
- "post": {
- "operationId": "login-confirm-password",
- "summary": "Confirm the user password",
+ "/ocs/v2.php/core/autocomplete/get": {
+ "get": {
+ "operationId": "auto_complete-get",
+ "summary": "Autocomplete a query",
"tags": [
- "login"
+ "auto_complete"
],
"security": [
{
@@ -936,55 +990,120 @@
],
"parameters": [
{
- "name": "password",
+ "name": "search",
"in": "query",
- "description": "The password of the user",
+ "description": "Text to search for",
"required": true,
"schema": {
"type": "string"
}
+ },
+ {
+ "name": "itemType",
+ "in": "query",
+ "description": "Type of the items to search for",
+ "schema": {
+ "type": "string",
+ "nullable": true
+ }
+ },
+ {
+ "name": "itemId",
+ "in": "query",
+ "description": "ID of the items to search for",
+ "schema": {
+ "type": "string",
+ "nullable": true
+ }
+ },
+ {
+ "name": "sorter",
+ "in": "query",
+ "description": "can be piped, top prio first, e.g.: \"commenters|share-recipients\"",
+ "schema": {
+ "type": "string",
+ "nullable": true
+ }
+ },
+ {
+ "name": "shareTypes[]",
+ "in": "query",
+ "description": "Types of shares to search for",
+ "schema": {
+ "type": "array",
+ "default": [],
+ "items": {
+ "type": "integer",
+ "format": "int64"
+ }
+ }
+ },
+ {
+ "name": "limit",
+ "in": "query",
+ "description": "Maximum number of results to return",
+ "schema": {
+ "type": "integer",
+ "format": "int64",
+ "default": 10
+ }
+ },
+ {
+ "name": "OCS-APIRequest",
+ "in": "header",
+ "description": "Required to be true for the API request to pass",
+ "required": true,
+ "schema": {
+ "type": "boolean",
+ "default": true
+ }
}
],
"responses": {
"200": {
- "description": "Password confirmation succeeded",
+ "description": "Autocomplete results returned",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
- "lastLogin"
+ "ocs"
],
"properties": {
- "lastLogin": {
- "type": "integer",
- "format": "int64"
+ "ocs": {
+ "type": "object",
+ "required": [
+ "meta",
+ "data"
+ ],
+ "properties": {
+ "meta": {
+ "$ref": "#/components/schemas/OCSMeta"
+ },
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/AutocompleteResult"
+ }
+ }
+ }
}
}
}
}
}
- },
- "403": {
- "description": "Password confirmation failed",
- "content": {
- "application/json": {
- "schema": {}
- }
- }
}
}
}
},
- "/index.php/login/v2/poll": {
- "post": {
- "operationId": "client_flow_login_v2-poll",
- "summary": "Poll the login flow credentials",
+ "/ocs/v2.php/collaboration/resources/collections/{collectionId}": {
+ "get": {
+ "operationId": "collaboration_resources-list-collection",
+ "summary": "Get a collection",
"tags": [
- "client_flow_login_v2"
+ "collaboration_resources"
],
"security": [
- {},
{
"bearer_auth": []
},
@@ -994,73 +1113,120 @@
],
"parameters": [
{
- "name": "token",
- "in": "query",
- "description": "Token of the flow",
+ "name": "collectionId",
+ "in": "path",
+ "description": "ID of the collection",
"required": true,
"schema": {
- "type": "string"
+ "type": "integer",
+ "format": "int64"
+ }
+ },
+ {
+ "name": "OCS-APIRequest",
+ "in": "header",
+ "description": "Required to be true for the API request to pass",
+ "required": true,
+ "schema": {
+ "type": "boolean",
+ "default": true
}
}
],
"responses": {
"200": {
- "description": "Login flow credentials returned",
+ "description": "Collection returned",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/LoginFlowV2Credentials"
+ "type": "object",
+ "required": [
+ "ocs"
+ ],
+ "properties": {
+ "ocs": {
+ "type": "object",
+ "required": [
+ "meta",
+ "data"
+ ],
+ "properties": {
+ "meta": {
+ "$ref": "#/components/schemas/OCSMeta"
+ },
+ "data": {
+ "$ref": "#/components/schemas/Collection"
+ }
+ }
+ }
+ }
}
}
}
},
"404": {
- "description": "Login flow not found or completed",
+ "description": "Collection not found",
"content": {
"application/json": {
- "schema": {}
- }
- }
- }
- }
- }
- },
- "/index.php/login/v2": {
- "post": {
- "operationId": "client_flow_login_v2-init",
- "summary": "Init a login flow",
- "tags": [
- "client_flow_login_v2"
- ],
- "security": [
- {},
- {
- "bearer_auth": []
+ "schema": {
+ "type": "object",
+ "required": [
+ "ocs"
+ ],
+ "properties": {
+ "ocs": {
+ "type": "object",
+ "required": [
+ "meta",
+ "data"
+ ],
+ "properties": {
+ "meta": {
+ "$ref": "#/components/schemas/OCSMeta"
+ },
+ "data": {}
+ }
+ }
+ }
+ }
+ }
+ }
},
- {
- "basic_auth": []
- }
- ],
- "responses": {
- "200": {
- "description": "Login flow init returned",
+ "500": {
+ "description": "",
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/LoginFlowV2"
+ "type": "object",
+ "required": [
+ "ocs"
+ ],
+ "properties": {
+ "ocs": {
+ "type": "object",
+ "required": [
+ "meta",
+ "data"
+ ],
+ "properties": {
+ "meta": {
+ "$ref": "#/components/schemas/OCSMeta"
+ },
+ "data": {}
+ }
+ }
+ }
}
}
}
}
}
- }
- },
- "/index.php/core/preview": {
- "get": {
- "operationId": "preview-get-preview-by-file-id",
- "summary": "Get a preview by file ID",
+ },
+ "post": {
+ "operationId": "collaboration_resources-add-resource",
+ "summary": "Add a resource to a collection",
"tags": [
- "preview"
+ "collaboration_resources"
],
"security": [
{
@@ -1072,139 +1238,138 @@
],
"parameters": [
{
- "name": "fileId",
- "in": "query",
- "description": "ID of the file",
- "schema": {
- "type": "integer",
- "format": "int64",
- "default": -1
- }
- },
- {
- "name": "x",
- "in": "query",
- "description": "Width of the preview",
- "schema": {
- "type": "integer",
- "format": "int64",
- "default": 32
- }
- },
- {
- "name": "y",
+ "name": "resourceType",
"in": "query",
- "description": "Height of the preview",
+ "description": "Name of the resource",
+ "required": true,
"schema": {
- "type": "integer",
- "format": "int64",
- "default": 32
+ "type": "string"
}
},
{
- "name": "a",
+ "name": "resourceId",
"in": "query",
- "description": "Whether to not crop the preview",
+ "description": "ID of the resource",
+ "required": true,
"schema": {
- "type": "integer",
- "default": 0,
- "enum": [
- 0,
- 1
- ]
+ "type": "string"
}
},
{
- "name": "forceIcon",
- "in": "query",
- "description": "Force returning an icon",
+ "name": "collectionId",
+ "in": "path",
+ "description": "ID of the collection",
+ "required": true,
"schema": {
"type": "integer",
- "default": 1,
- "enum": [
- 0,
- 1
- ]
- }
- },
- {
- "name": "mode",
- "in": "query",
- "description": "How to crop the image",
- "schema": {
- "type": "string",
- "default": "fill"
+ "format": "int64"
}
},
{
- "name": "mimeFallback",
- "in": "query",
- "description": "Whether to fallback to the mime icon if no preview is available",
+ "name": "OCS-APIRequest",
+ "in": "header",
+ "description": "Required to be true for the API request to pass",
+ "required": true,
"schema": {
- "type": "integer",
- "default": 0,
- "enum": [
- 0,
- 1
- ]
+ "type": "boolean",
+ "default": true
}
}
],
"responses": {
"200": {
- "description": "Preview returned",
+ "description": "Collection returned",
"content": {
- "*/*": {
+ "application/json": {
"schema": {
- "type": "string",
- "format": "binary"
+ "type": "object",
+ "required": [
+ "ocs"
+ ],
+ "properties": {
+ "ocs": {
+ "type": "object",
+ "required": [
+ "meta",
+ "data"
+ ],
+ "properties": {
+ "meta": {
+ "$ref": "#/components/schemas/OCSMeta"
+ },
+ "data": {
+ "$ref": "#/components/schemas/Collection"
+ }
+ }
+ }
+ }
}
}
}
},
- "400": {
- "description": "Getting preview is not possible",
- "content": {
- "application/json": {
- "schema": {}
- }
- }
- },
- "403": {
- "description": "Getting preview is not allowed",
+ "404": {
+ "description": "Collection not found or resource inaccessible",
"content": {
"application/json": {
- "schema": {}
+ "schema": {
+ "type": "object",
+ "required": [
+ "ocs"
+ ],
+ "properties": {
+ "ocs": {
+ "type": "object",
+ "required": [
+ "meta",
+ "data"
+ ],
+ "properties": {
+ "meta": {
+ "$ref": "#/components/schemas/OCSMeta"
+ },
+ "data": {}
+ }
+ }
+ }
+ }
}
}
},
- "404": {
- "description": "Preview not found",
+ "500": {
+ "description": "",
"content": {
"application/json": {
- "schema": {}
- }
- }
- },
- "303": {
- "description": "Redirect to the mime icon url if mimeFallback is true",
- "headers": {
- "Location": {
"schema": {
- "type": "string"
+ "type": "object",
+ "required": [
+ "ocs"
+ ],
+ "properties": {
+ "ocs": {
+ "type": "object",
+ "required": [
+ "meta",
+ "data"
+ ],
+ "properties": {
+ "meta": {
+ "$ref": "#/components/schemas/OCSMeta"
+ },
+ "data": {}
+ }
+ }
+ }
}
}
}
}
}
- }
- },
- "/index.php/core/preview.png": {
- "get": {
- "operationId": "preview-get-preview",
- "summary": "Get a preview by file path",
+ },
+ "delete": {
+ "operationId": "collaboration_resources-remove-resource",
+ "summary": "Remove a resource from a collection",
"tags": [
- "preview"
+ "collaboration_resources"
],
"security": [
{
@@ -1216,141 +1381,140 @@
],
"parameters": [
{
- "name": "file",
+ "name": "resourceType",
"in": "query",
- "description": "Path of the file",
- "schema": {
- "type": "string",
- "default": ""
- }
- },
- {
- "name": "x",
- "in": "query",
- "description": "Width of the preview",
- "schema": {
- "type": "integer",
- "format": "int64",
- "default": 32
- }
- },
- {
- "name": "y",
- "in": "query",
- "description": "Height of the preview",
+ "description": "Name of the resource",
+ "required": true,
"schema": {
- "type": "integer",
- "format": "int64",
- "default": 32
+ "type": "string"
}
},
{
- "name": "a",
+ "name": "resourceId",
"in": "query",
- "description": "Whether to not crop the preview",
+ "description": "ID of the resource",
+ "required": true,
"schema": {
- "type": "integer",
- "default": 0,
- "enum": [
- 0,
- 1
- ]
+ "type": "string"
}
},
{
- "name": "forceIcon",
- "in": "query",
- "description": "Force returning an icon",
+ "name": "collectionId",
+ "in": "path",
+ "description": "ID of the collection",
+ "required": true,
"schema": {
"type": "integer",
- "default": 1,
- "enum": [
- 0,
- 1
- ]
- }
- },
- {
- "name": "mode",
- "in": "query",
- "description": "How to crop the image",
- "schema": {
- "type": "string",
- "default": "fill"
+ "format": "int64"
}
},
{
- "name": "mimeFallback",
- "in": "query",
- "description": "Whether to fallback to the mime icon if no preview is available",
+ "name": "OCS-APIRequest",
+ "in": "header",
+ "description": "Required to be true for the API request to pass",
+ "required": true,
"schema": {
- "type": "integer",
- "default": 0,
- "enum": [
- 0,
- 1
- ]
+ "type": "boolean",
+ "default": true
}
}
],
"responses": {
"200": {
- "description": "Preview returned",
+ "description": "Collection returned",
"content": {
- "*/*": {
+ "application/json": {
"schema": {
- "type": "string",
- "format": "binary"
+ "type": "object",
+ "required": [
+ "ocs"
+ ],
+ "properties": {
+ "ocs": {
+ "type": "object",
+ "required": [
+ "meta",
+ "data"
+ ],
+ "properties": {
+ "meta": {
+ "$ref": "#/components/schemas/OCSMeta"
+ },
+ "data": {
+ "$ref": "#/components/schemas/Collection"
+ }
+ }
+ }
+ }
}
}
}
},
- "400": {
- "description": "Getting preview is not possible",
- "content": {
- "application/json": {
- "schema": {}
- }
- }
- },
- "403": {
- "description": "Getting preview is not allowed",
+ "404": {
+ "description": "Collection or resource not found",
"content": {
"application/json": {
- "schema": {}
+ "schema": {
+ "type": "object",
+ "required": [
+ "ocs"
+ ],
+ "properties": {
+ "ocs": {
+ "type": "object",
+ "required": [
+ "meta",
+ "data"
+ ],
+ "properties": {
+ "meta": {
+ "$ref": "#/components/schemas/OCSMeta"
+ },
+ "data": {}
+ }
+ }
+ }
+ }
}
}
},
- "404": {
- "description": "Preview not found",
+ "500": {
+ "description": "",
"content": {
"application/json": {
- "schema": {}
- }
- }
- },
- "303": {
- "description": "Redirect to the mime icon url if mimeFallback is true",
- "headers": {
- "Location": {
"schema": {
- "type": "string"
+ "type": "object",
+ "required": [
+ "ocs"
+ ],
+ "properties": {
+ "ocs": {
+ "type": "object",
+ "required": [
+ "meta",
+ "data"
+ ],
+ "properties": {
+ "meta": {
+ "$ref": "#/components/schemas/OCSMeta"
+ },
+ "data": {}
+ }
+ }
+ }
}
}
}
}
}
- }
- },
- "/index.php/core/references/preview/{referenceId}": {
- "get": {
- "operationId": "reference-preview",
- "summary": "Get a preview for a reference",
+ },
+ "put": {
+ "operationId": "collaboration_resources-rename-collection",
+ "summary": "Rename a collection",
"tags": [
- "reference"
+ "collaboration_resources"
],
"security": [
- {},
{
"bearer_auth": []
},
@@ -1360,106 +1524,133 @@
],
"parameters": [
{
- "name": "referenceId",
- "in": "path",
- "description": "the reference cache key",
+ "name": "collectionName",
+ "in": "query",
+ "description": "New name",
"required": true,
"schema": {
"type": "string"
}
- }
- ],
- "responses": {
- "200": {
- "description": "Preview returned",
- "content": {
- "*/*": {
- "schema": {
- "type": "string",
- "format": "binary"
- }
- }
- }
},
- "404": {
- "description": "Reference not found",
- "content": {
- "application/json": {
- "schema": {
- "type": "string"
- }
- }
- }
- }
- }
- }
- },
- "/index.php/core/wipe/check": {
- "post": {
- "operationId": "wipe-check-wipe",
- "summary": "Check if the device should be wiped",
- "tags": [
- "wipe"
- ],
- "security": [
- {},
{
- "bearer_auth": []
+ "name": "collectionId",
+ "in": "path",
+ "description": "ID of the collection",
+ "required": true,
+ "schema": {
+ "type": "integer",
+ "format": "int64"
+ }
},
{
- "basic_auth": []
- }
- ],
- "parameters": [
- {
- "name": "token",
- "in": "query",
- "description": "App password",
+ "name": "OCS-APIRequest",
+ "in": "header",
+ "description": "Required to be true for the API request to pass",
"required": true,
"schema": {
- "type": "string"
+ "type": "boolean",
+ "default": true
}
}
],
"responses": {
"200": {
- "description": "Device should be wiped",
+ "description": "Collection returned",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
- "wipe"
+ "ocs"
],
"properties": {
- "wipe": {
- "type": "boolean"
- }
- }
- }
- }
- }
- },
- "404": {
- "description": "Device should not be wiped",
+ "ocs": {
+ "type": "object",
+ "required": [
+ "meta",
+ "data"
+ ],
+ "properties": {
+ "meta": {
+ "$ref": "#/components/schemas/OCSMeta"
+ },
+ "data": {
+ "$ref": "#/components/schemas/Collection"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Collection not found",
"content": {
"application/json": {
- "schema": {}
+ "schema": {
+ "type": "object",
+ "required": [
+ "ocs"
+ ],
+ "properties": {
+ "ocs": {
+ "type": "object",
+ "required": [
+ "meta",
+ "data"
+ ],
+ "properties": {
+ "meta": {
+ "$ref": "#/components/schemas/OCSMeta"
+ },
+ "data": {}
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "ocs"
+ ],
+ "properties": {
+ "ocs": {
+ "type": "object",
+ "required": [
+ "meta",
+ "data"
+ ],
+ "properties": {
+ "meta": {
+ "$ref": "#/components/schemas/OCSMeta"
+ },
+ "data": {}
+ }
+ }
+ }
+ }
}
}
}
}
}
},
- "/index.php/core/wipe/success": {
- "post": {
- "operationId": "wipe-wipe-done",
- "summary": "Finish the wipe",
+ "/ocs/v2.php/collaboration/resources/collections/search/{filter}": {
+ "get": {
+ "operationId": "collaboration_resources-search-collections",
+ "summary": "Search for collections",
"tags": [
- "wipe"
+ "collaboration_resources"
],
"security": [
- {},
{
"bearer_auth": []
},
@@ -1469,113 +1660,50 @@
],
"parameters": [
{
- "name": "token",
- "in": "query",
- "description": "App password",
+ "name": "filter",
+ "in": "path",
+ "description": "Filter collections",
"required": true,
"schema": {
"type": "string"
}
- }
- ],
- "responses": {
- "200": {
- "description": "Wipe finished successfully",
- "content": {
- "application/json": {
- "schema": {}
- }
- }
- },
- "404": {
- "description": "Device should not be wiped",
- "content": {
- "application/json": {
- "schema": {}
- }
- }
- }
- }
- }
- },
- "/index.php/ocm-provider": {
- "get": {
- "operationId": "ocm-discovery",
- "summary": "generate a OCMProvider with local data and send it as DataResponse. This replaces the old PHP file ocm-provider/index.php",
- "tags": [
- "ocm"
- ],
- "security": [
- {},
- {
- "bearer_auth": []
},
{
- "basic_auth": []
+ "name": "OCS-APIRequest",
+ "in": "header",
+ "description": "Required to be true for the API request to pass",
+ "required": true,
+ "schema": {
+ "type": "boolean",
+ "default": true
+ }
}
],
"responses": {
"200": {
- "description": "OCM Provider details returned",
- "headers": {
- "X-NEXTCLOUD-OCM-PROVIDERS": {
- "schema": {
- "type": "boolean",
- "enum": [
- true
- ]
- }
- }
- },
+ "description": "Collections returned",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
- "enabled",
- "apiVersion",
- "endPoint",
- "resourceTypes"
+ "ocs"
],
"properties": {
- "enabled": {
- "type": "boolean"
- },
- "apiVersion": {
- "type": "string"
- },
- "endPoint": {
- "type": "string"
- },
- "resourceTypes": {
- "type": "array",
- "items": {
- "type": "object",
- "required": [
- "name",
- "shareTypes",
- "protocols"
- ],
- "properties": {
- "name": {
- "type": "string"
- },
- "shareTypes": {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "protocols": {
- "type": "object",
- "required": [
- "webdav"
- ],
- "properties": {
- "webdav": {
- "type": "string"
- }
- }
+ "ocs": {
+ "type": "object",
+ "required": [
+ "meta",
+ "data"
+ ],
+ "properties": {
+ "meta": {
+ "$ref": "#/components/schemas/OCSMeta"
+ },
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/Collection"
}
}
}
@@ -1585,18 +1713,28 @@
}
}
},
- "500": {
- "description": "OCM not supported",
+ "404": {
+ "description": "Collection not found",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
- "message"
+ "ocs"
],
"properties": {
- "message": {
- "type": "string"
+ "ocs": {
+ "type": "object",
+ "required": [
+ "meta",
+ "data"
+ ],
+ "properties": {
+ "meta": {
+ "$ref": "#/components/schemas/OCSMeta"
+ },
+ "data": {}
+ }
}
}
}
@@ -1606,15 +1744,14 @@
}
}
},
- "/ocs/v2.php/cloud/capabilities": {
+ "/ocs/v2.php/collaboration/resources/{resourceType}/{resourceId}": {
"get": {
- "operationId": "ocs-get-capabilities",
- "summary": "Get the capabilities",
+ "operationId": "collaboration_resources-get-collections-by-resource",
+ "summary": "Get collections by resource",
"tags": [
- "ocs"
+ "collaboration_resources"
],
"security": [
- {},
{
"bearer_auth": []
},
@@ -1623,6 +1760,24 @@
}
],
"parameters": [
+ {
+ "name": "resourceType",
+ "in": "path",
+ "description": "Type of the resource",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "resourceId",
+ "in": "path",
+ "description": "ID of the resource",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
{
"name": "OCS-APIRequest",
"in": "header",
@@ -1636,7 +1791,7 @@
],
"responses": {
"200": {
- "description": "Capabilities returned",
+ "description": "Collections returned",
"content": {
"application/json": {
"schema": {
@@ -1656,52 +1811,9 @@
"$ref": "#/components/schemas/OCSMeta"
},
"data": {
- "type": "object",
- "required": [
- "version",
- "capabilities"
- ],
- "properties": {
- "version": {
- "type": "object",
- "required": [
- "major",
- "minor",
- "micro",
- "string",
- "edition",
- "extendedSupport"
- ],
- "properties": {
- "major": {
- "type": "integer",
- "format": "int64"
- },
- "minor": {
- "type": "integer",
- "format": "int64"
- },
- "micro": {
- "type": "integer",
- "format": "int64"
- },
- "string": {
- "type": "string"
- },
- "edition": {
- "type": "string"
- },
- "extendedSupport": {
- "type": "boolean"
- }
- }
- },
- "capabilities": {
- "type": "object",
- "additionalProperties": {
- "type": "object"
- }
- }
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/Collection"
}
}
}
@@ -1710,16 +1822,44 @@
}
}
}
+ },
+ "404": {
+ "description": "Resource not accessible",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "ocs"
+ ],
+ "properties": {
+ "ocs": {
+ "type": "object",
+ "required": [
+ "meta",
+ "data"
+ ],
+ "properties": {
+ "meta": {
+ "$ref": "#/components/schemas/OCSMeta"
+ },
+ "data": {}
+ }
+ }
+ }
+ }
+ }
+ }
}
}
}
},
- "/ocs/v2.php/core/navigation/apps": {
- "get": {
- "operationId": "navigation-get-apps-navigation",
- "summary": "Get the apps navigation",
+ "/ocs/v2.php/collaboration/resources/{baseResourceType}/{baseResourceId}": {
+ "post": {
+ "operationId": "collaboration_resources-create-collection-on-resource",
+ "summary": "Create a collection for a resource",
"tags": [
- "navigation"
+ "collaboration_resources"
],
"security": [
{
@@ -1731,16 +1871,30 @@
],
"parameters": [
{
- "name": "absolute",
+ "name": "name",
"in": "query",
- "description": "Rewrite URLs to absolute ones",
+ "description": "Name of the collection",
+ "required": true,
"schema": {
- "type": "integer",
- "default": 0,
- "enum": [
- 0,
- 1
- ]
+ "type": "string"
+ }
+ },
+ {
+ "name": "baseResourceType",
+ "in": "path",
+ "description": "Type of the base resource",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "baseResourceId",
+ "in": "path",
+ "description": "ID of the base resource",
+ "required": true,
+ "schema": {
+ "type": "string"
}
},
{
@@ -1756,7 +1910,7 @@
],
"responses": {
"200": {
- "description": "Apps navigation returned",
+ "description": "Collection returned",
"content": {
"application/json": {
"schema": {
@@ -1776,10 +1930,7 @@
"$ref": "#/components/schemas/OCSMeta"
},
"data": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/NavigationEntry"
- }
+ "$ref": "#/components/schemas/Collection"
}
}
}
@@ -1788,8 +1939,64 @@
}
}
},
- "304": {
- "description": "No apps navigation changed",
+ "400": {
+ "description": "Creating collection is not possible",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "ocs"
+ ],
+ "properties": {
+ "ocs": {
+ "type": "object",
+ "required": [
+ "meta",
+ "data"
+ ],
+ "properties": {
+ "meta": {
+ "$ref": "#/components/schemas/OCSMeta"
+ },
+ "data": {}
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Resource inaccessible",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "ocs"
+ ],
+ "properties": {
+ "ocs": {
+ "type": "object",
+ "required": [
+ "meta",
+ "data"
+ ],
+ "properties": {
+ "meta": {
+ "$ref": "#/components/schemas/OCSMeta"
+ },
+ "data": {}
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "",
"content": {
"application/json": {
"schema": {
@@ -1819,12 +2026,12 @@
}
}
},
- "/ocs/v2.php/core/navigation/settings": {
+ "/ocs/v2.php/hovercard/v1/{userId}": {
"get": {
- "operationId": "navigation-get-settings-navigation",
- "summary": "Get the settings navigation",
+ "operationId": "hover_card-get-user",
+ "summary": "Get the account details for a hovercard",
"tags": [
- "navigation"
+ "hover_card"
],
"security": [
{
@@ -1836,16 +2043,12 @@
],
"parameters": [
{
- "name": "absolute",
- "in": "query",
- "description": "Rewrite URLs to absolute ones",
+ "name": "userId",
+ "in": "path",
+ "description": "ID of the user",
+ "required": true,
"schema": {
- "type": "integer",
- "default": 0,
- "enum": [
- 0,
- 1
- ]
+ "type": "string"
}
},
{
@@ -1861,7 +2064,7 @@
],
"responses": {
"200": {
- "description": "Apps navigation returned",
+ "description": "Account details returned",
"content": {
"application/json": {
"schema": {
@@ -1881,9 +2084,25 @@
"$ref": "#/components/schemas/OCSMeta"
},
"data": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/NavigationEntry"
+ "type": "object",
+ "required": [
+ "userId",
+ "displayName",
+ "actions"
+ ],
+ "properties": {
+ "userId": {
+ "type": "string"
+ },
+ "displayName": {
+ "type": "string"
+ },
+ "actions": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/ContactsAction"
+ }
+ }
}
}
}
@@ -1893,8 +2112,8 @@
}
}
},
- "304": {
- "description": "No apps navigation changed",
+ "404": {
+ "description": "Account not found",
"content": {
"application/json": {
"schema": {
@@ -1924,12 +2143,12 @@
}
}
},
- "/ocs/v2.php/core/autocomplete/get": {
+ "/ocs/v2.php/core/navigation/apps": {
"get": {
- "operationId": "auto_complete-get",
- "summary": "Autocomplete a query",
+ "operationId": "navigation-get-apps-navigation",
+ "summary": "Get the apps navigation",
"tags": [
- "auto_complete"
+ "navigation"
],
"security": [
{
@@ -1941,68 +2160,23 @@
],
"parameters": [
{
- "name": "search",
+ "name": "absolute",
"in": "query",
- "description": "Text to search for",
- "required": true,
+ "description": "Rewrite URLs to absolute ones",
"schema": {
- "type": "string"
+ "type": "integer",
+ "default": 0,
+ "enum": [
+ 0,
+ 1
+ ]
}
},
{
- "name": "itemType",
- "in": "query",
- "description": "Type of the items to search for",
- "schema": {
- "type": "string",
- "nullable": true
- }
- },
- {
- "name": "itemId",
- "in": "query",
- "description": "ID of the items to search for",
- "schema": {
- "type": "string",
- "nullable": true
- }
- },
- {
- "name": "sorter",
- "in": "query",
- "description": "can be piped, top prio first, e.g.: \"commenters|share-recipients\"",
- "schema": {
- "type": "string",
- "nullable": true
- }
- },
- {
- "name": "shareTypes[]",
- "in": "query",
- "description": "Types of shares to search for",
- "schema": {
- "type": "array",
- "items": {
- "type": "integer",
- "format": "int64"
- }
- }
- },
- {
- "name": "limit",
- "in": "query",
- "description": "Maximum number of results to return",
- "schema": {
- "type": "integer",
- "format": "int64",
- "default": 10
- }
- },
- {
- "name": "OCS-APIRequest",
- "in": "header",
- "description": "Required to be true for the API request to pass",
- "required": true,
+ "name": "OCS-APIRequest",
+ "in": "header",
+ "description": "Required to be true for the API request to pass",
+ "required": true,
"schema": {
"type": "boolean",
"default": true
@@ -2011,7 +2185,7 @@
],
"responses": {
"200": {
- "description": "Autocomplete results returned",
+ "description": "Apps navigation returned",
"content": {
"application/json": {
"schema": {
@@ -2033,7 +2207,7 @@
"data": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/AutocompleteResult"
+ "$ref": "#/components/schemas/NavigationEntry"
}
}
}
@@ -2042,16 +2216,44 @@
}
}
}
+ },
+ "304": {
+ "description": "No apps navigation changed",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "ocs"
+ ],
+ "properties": {
+ "ocs": {
+ "type": "object",
+ "required": [
+ "meta",
+ "data"
+ ],
+ "properties": {
+ "meta": {
+ "$ref": "#/components/schemas/OCSMeta"
+ },
+ "data": {}
+ }
+ }
+ }
+ }
+ }
+ }
}
}
}
},
- "/ocs/v2.php/core/whatsnew": {
+ "/ocs/v2.php/core/navigation/settings": {
"get": {
- "operationId": "whats_new-get",
- "summary": "Get the changes",
+ "operationId": "navigation-get-settings-navigation",
+ "summary": "Get the settings navigation",
"tags": [
- "whats_new"
+ "navigation"
],
"security": [
{
@@ -2062,6 +2264,19 @@
}
],
"parameters": [
+ {
+ "name": "absolute",
+ "in": "query",
+ "description": "Rewrite URLs to absolute ones",
+ "schema": {
+ "type": "integer",
+ "default": 0,
+ "enum": [
+ 0,
+ 1
+ ]
+ }
+ },
{
"name": "OCS-APIRequest",
"in": "header",
@@ -2075,7 +2290,7 @@
],
"responses": {
"200": {
- "description": "Changes returned",
+ "description": "Apps navigation returned",
"content": {
"application/json": {
"schema": {
@@ -2095,43 +2310,9 @@
"$ref": "#/components/schemas/OCSMeta"
},
"data": {
- "type": "object",
- "required": [
- "changelogURL",
- "product",
- "version"
- ],
- "properties": {
- "changelogURL": {
- "type": "string"
- },
- "product": {
- "type": "string"
- },
- "version": {
- "type": "string"
- },
- "whatsNew": {
- "type": "object",
- "required": [
- "regular",
- "admin"
- ],
- "properties": {
- "regular": {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- "admin": {
- "type": "array",
- "items": {
- "type": "string"
- }
- }
- }
- }
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/NavigationEntry"
}
}
}
@@ -2141,8 +2322,8 @@
}
}
},
- "204": {
- "description": "No changes",
+ "304": {
+ "description": "No apps navigation changed",
"content": {
"application/json": {
"schema": {
@@ -2170,14 +2351,17 @@
}
}
}
- },
- "post": {
- "operationId": "whats_new-dismiss",
- "summary": "Dismiss the changes",
+ }
+ },
+ "/ocs/v2.php/cloud/capabilities": {
+ "get": {
+ "operationId": "ocs-get-capabilities",
+ "summary": "Get the capabilities",
"tags": [
- "whats_new"
+ "ocs"
],
"security": [
+ {},
{
"bearer_auth": []
},
@@ -2186,15 +2370,6 @@
}
],
"parameters": [
- {
- "name": "version",
- "in": "query",
- "description": "Version to dismiss the changes for",
- "required": true,
- "schema": {
- "type": "string"
- }
- },
{
"name": "OCS-APIRequest",
"in": "header",
@@ -2208,7 +2383,7 @@
],
"responses": {
"200": {
- "description": "Changes dismissed",
+ "description": "Capabilities returned",
"content": {
"application/json": {
"schema": {
@@ -2227,33 +2402,71 @@
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
- "data": {}
+ "data": {
+ "type": "object",
+ "required": [
+ "version",
+ "capabilities"
+ ],
+ "properties": {
+ "version": {
+ "type": "object",
+ "required": [
+ "major",
+ "minor",
+ "micro",
+ "string",
+ "edition",
+ "extendedSupport"
+ ],
+ "properties": {
+ "major": {
+ "type": "integer",
+ "format": "int64"
+ },
+ "minor": {
+ "type": "integer",
+ "format": "int64"
+ },
+ "micro": {
+ "type": "integer",
+ "format": "int64"
+ },
+ "string": {
+ "type": "string"
+ },
+ "edition": {
+ "type": "string"
+ },
+ "extendedSupport": {
+ "type": "boolean"
+ }
+ }
+ },
+ "capabilities": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "object"
+ }
+ }
+ }
+ }
}
}
}
}
}
}
- },
- "500": {
- "description": "",
- "content": {
- "text/plain": {
- "schema": {
- "type": "string"
- }
- }
- }
}
}
}
},
- "/ocs/v2.php/core/getapppassword": {
- "get": {
- "operationId": "app_password-get-app-password",
- "summary": "Create app password",
+ "/ocs/v2.php/profile/{targetUserId}": {
+ "put": {
+ "operationId": "profile_api-set-visibility",
+ "summary": "Update the visibility of a parameter",
"tags": [
- "app_password"
+ "profile_api"
],
"security": [
{
@@ -2265,19 +2478,46 @@
],
"parameters": [
{
- "name": "OCS-APIRequest",
- "in": "header",
- "description": "Required to be true for the API request to pass",
+ "name": "paramId",
+ "in": "query",
+ "description": "ID of the parameter",
"required": true,
"schema": {
- "type": "boolean",
- "default": true
+ "type": "string"
}
- }
- ],
- "responses": {
- "200": {
- "description": "App password returned",
+ },
+ {
+ "name": "visibility",
+ "in": "query",
+ "description": "New visibility",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "targetUserId",
+ "in": "path",
+ "description": "ID of the user",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "OCS-APIRequest",
+ "in": "header",
+ "description": "Required to be true for the API request to pass",
+ "required": true,
+ "schema": {
+ "type": "boolean",
+ "default": true
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Visibility updated successfully",
"content": {
"application/json": {
"schema": {
@@ -2296,17 +2536,7 @@
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
- "data": {
- "type": "object",
- "required": [
- "apppassword"
- ],
- "properties": {
- "apppassword": {
- "type": "string"
- }
- }
- }
+ "data": {}
}
}
}
@@ -2314,8 +2544,28 @@
}
}
},
+ "400": {
+ "description": "Updating visibility is not possible",
+ "content": {
+ "text/plain": {
+ "schema": {
+ "type": "string"
+ }
+ }
+ }
+ },
"403": {
- "description": "Creating app password is not allowed",
+ "description": "Not allowed to edit other users visibility",
+ "content": {
+ "text/plain": {
+ "schema": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Account not found",
"content": {
"text/plain": {
"schema": {
@@ -2327,12 +2577,12 @@
}
}
},
- "/ocs/v2.php/core/apppassword/rotate": {
+ "/ocs/v2.php/references/extract": {
"post": {
- "operationId": "app_password-rotate-app-password",
- "summary": "Rotate app password",
+ "operationId": "reference_api-extract",
+ "summary": "Extract references from a text",
"tags": [
- "app_password"
+ "reference_api"
],
"security": [
{
@@ -2343,6 +2593,38 @@
}
],
"parameters": [
+ {
+ "name": "text",
+ "in": "query",
+ "description": "Text to extract from",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "resolve",
+ "in": "query",
+ "description": "Resolve the references",
+ "schema": {
+ "type": "integer",
+ "default": 0,
+ "enum": [
+ 0,
+ 1
+ ]
+ }
+ },
+ {
+ "name": "limit",
+ "in": "query",
+ "description": "Maximum amount of references to extract",
+ "schema": {
+ "type": "integer",
+ "format": "int64",
+ "default": 1
+ }
+ },
{
"name": "OCS-APIRequest",
"in": "header",
@@ -2356,7 +2638,7 @@
],
"responses": {
"200": {
- "description": "App password returned",
+ "description": "References returned",
"content": {
"application/json": {
"schema": {
@@ -2378,11 +2660,15 @@
"data": {
"type": "object",
"required": [
- "apppassword"
+ "references"
],
"properties": {
- "apppassword": {
- "type": "string"
+ "references": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/components/schemas/Reference",
+ "nullable": true
+ }
}
}
}
@@ -2392,26 +2678,16 @@
}
}
}
- },
- "403": {
- "description": "Rotating app password is not allowed",
- "content": {
- "text/plain": {
- "schema": {
- "type": "string"
- }
- }
- }
}
}
}
},
- "/ocs/v2.php/core/apppassword": {
- "delete": {
- "operationId": "app_password-delete-app-password",
- "summary": "Delete app password",
+ "/ocs/v2.php/references/resolve": {
+ "get": {
+ "operationId": "reference_api-resolve-one",
+ "summary": "Resolve a reference",
"tags": [
- "app_password"
+ "reference_api"
],
"security": [
{
@@ -2422,6 +2698,15 @@
}
],
"parameters": [
+ {
+ "name": "reference",
+ "in": "query",
+ "description": "Reference to resolve",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
{
"name": "OCS-APIRequest",
"in": "header",
@@ -2435,7 +2720,7 @@
],
"responses": {
"200": {
- "description": "App password deleted successfully",
+ "description": "Reference returned",
"content": {
"application/json": {
"schema": {
@@ -2454,33 +2739,35 @@
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
- "data": {}
+ "data": {
+ "type": "object",
+ "required": [
+ "references"
+ ],
+ "properties": {
+ "references": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/components/schemas/Reference",
+ "nullable": true
+ }
+ }
+ }
+ }
}
}
}
}
}
}
- },
- "403": {
- "description": "Deleting app password is not allowed",
- "content": {
- "text/plain": {
- "schema": {
- "type": "string"
- }
- }
- }
}
}
- }
- },
- "/ocs/v2.php/core/apppassword/confirm": {
- "put": {
- "operationId": "app_password-confirm-user-password",
- "summary": "Confirm the user password",
+ },
+ "post": {
+ "operationId": "reference_api-resolve",
+ "summary": "Resolve multiple references",
"tags": [
- "app_password"
+ "reference_api"
],
"security": [
{
@@ -2492,12 +2779,25 @@
],
"parameters": [
{
- "name": "password",
+ "name": "references[]",
"in": "query",
- "description": "The password of the user",
+ "description": "References to resolve",
"required": true,
"schema": {
- "type": "string"
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ },
+ {
+ "name": "limit",
+ "in": "query",
+ "description": "Maximum amount of references to resolve",
+ "schema": {
+ "type": "integer",
+ "format": "int64",
+ "default": 1
}
},
{
@@ -2513,7 +2813,7 @@
],
"responses": {
"200": {
- "description": "Password confirmation succeeded",
+ "description": "References returned",
"content": {
"application/json": {
"schema": {
@@ -2535,12 +2835,15 @@
"data": {
"type": "object",
"required": [
- "lastLogin"
+ "references"
],
"properties": {
- "lastLogin": {
- "type": "integer",
- "format": "int64"
+ "references": {
+ "type": "object",
+ "additionalProperties": {
+ "$ref": "#/components/schemas/Reference",
+ "nullable": true
+ }
}
}
}
@@ -2550,9 +2853,40 @@
}
}
}
+ }
+ }
+ }
+ },
+ "/ocs/v2.php/references/providers": {
+ "get": {
+ "operationId": "reference_api-get-providers-info",
+ "summary": "Get the providers",
+ "tags": [
+ "reference_api"
+ ],
+ "security": [
+ {
+ "bearer_auth": []
},
- "403": {
- "description": "Password confirmation failed",
+ {
+ "basic_auth": []
+ }
+ ],
+ "parameters": [
+ {
+ "name": "OCS-APIRequest",
+ "in": "header",
+ "description": "Required to be true for the API request to pass",
+ "required": true,
+ "schema": {
+ "type": "boolean",
+ "default": true
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Providers returned",
"content": {
"application/json": {
"schema": {
@@ -2571,7 +2905,12 @@
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
- "data": {}
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/ReferenceProvider"
+ }
+ }
}
}
}
@@ -2582,12 +2921,12 @@
}
}
},
- "/ocs/v2.php/hovercard/v1/{userId}": {
- "get": {
- "operationId": "hover_card-get-user",
- "summary": "Get the account details for a hovercard",
+ "/ocs/v2.php/references/provider/{providerId}": {
+ "put": {
+ "operationId": "reference_api-touch-provider",
+ "summary": "Touch a provider",
"tags": [
- "hover_card"
+ "reference_api"
],
"security": [
{
@@ -2599,9 +2938,19 @@
],
"parameters": [
{
- "name": "userId",
+ "name": "timestamp",
+ "in": "query",
+ "description": "Timestamp of the last usage",
+ "schema": {
+ "type": "integer",
+ "format": "int64",
+ "nullable": true
+ }
+ },
+ {
+ "name": "providerId",
"in": "path",
- "description": "ID of the user",
+ "description": "ID of the provider",
"required": true,
"schema": {
"type": "string"
@@ -2620,7 +2969,7 @@
],
"responses": {
"200": {
- "description": "Account details returned",
+ "description": "Provider touched",
"content": {
"application/json": {
"schema": {
@@ -2642,22 +2991,11 @@
"data": {
"type": "object",
"required": [
- "userId",
- "displayName",
- "actions"
+ "success"
],
"properties": {
- "userId": {
- "type": "string"
- },
- "displayName": {
- "type": "string"
- },
- "actions": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/ContactsAction"
- }
+ "success": {
+ "type": "boolean"
}
}
}
@@ -2667,46 +3005,19 @@
}
}
}
- },
- "404": {
- "description": "Account not found",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "required": [
- "ocs"
- ],
- "properties": {
- "ocs": {
- "type": "object",
- "required": [
- "meta",
- "data"
- ],
- "properties": {
- "meta": {
- "$ref": "#/components/schemas/OCSMeta"
- },
- "data": {}
- }
- }
- }
- }
- }
- }
}
}
}
},
- "/ocs/v2.php/collaboration/resources/collections/search/{filter}": {
+ "/ocs/v2.php/textprocessing/tasktypes": {
"get": {
- "operationId": "collaboration_resources-search-collections",
- "summary": "Search for collections",
+ "operationId": "text_processing_api-task-types",
+ "summary": "This endpoint returns all available LanguageModel task types",
"tags": [
- "collaboration_resources"
+ "text_processing_api"
],
"security": [
+ {},
{
"bearer_auth": []
},
@@ -2715,15 +3026,6 @@
}
],
"parameters": [
- {
- "name": "filter",
- "in": "path",
- "description": "Filter collections",
- "required": true,
- "schema": {
- "type": "string"
- }
- },
{
"name": "OCS-APIRequest",
"in": "header",
@@ -2737,7 +3039,7 @@
],
"responses": {
"200": {
- "description": "Collections returned",
+ "description": "Task types returned",
"content": {
"application/json": {
"schema": {
@@ -2757,9 +3059,33 @@
"$ref": "#/components/schemas/OCSMeta"
},
"data": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/Collection"
+ "type": "object",
+ "required": [
+ "types"
+ ],
+ "properties": {
+ "types": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "required": [
+ "id",
+ "name",
+ "description"
+ ],
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "description": {
+ "type": "string"
+ }
+ }
+ }
+ }
}
}
}
@@ -2768,46 +3094,19 @@
}
}
}
- },
- "404": {
- "description": "Collection not found",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "required": [
- "ocs"
- ],
- "properties": {
- "ocs": {
- "type": "object",
- "required": [
- "meta",
- "data"
- ],
- "properties": {
- "meta": {
- "$ref": "#/components/schemas/OCSMeta"
- },
- "data": {}
- }
- }
- }
- }
- }
- }
}
}
}
},
- "/ocs/v2.php/collaboration/resources/collections/{collectionId}": {
- "get": {
- "operationId": "collaboration_resources-list-collection",
- "summary": "Get a collection",
+ "/ocs/v2.php/textprocessing/schedule": {
+ "post": {
+ "operationId": "text_processing_api-schedule",
+ "summary": "This endpoint allows scheduling a language model task",
"tags": [
- "collaboration_resources"
+ "text_processing_api"
],
"security": [
+ {},
{
"bearer_auth": []
},
@@ -2817,13 +3116,39 @@
],
"parameters": [
{
- "name": "collectionId",
- "in": "path",
- "description": "ID of the collection",
+ "name": "input",
+ "in": "query",
+ "description": "Input text",
"required": true,
"schema": {
- "type": "integer",
- "format": "int64"
+ "type": "string"
+ }
+ },
+ {
+ "name": "type",
+ "in": "query",
+ "description": "Type of the task",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "appId",
+ "in": "query",
+ "description": "ID of the app that will execute the task",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
+ {
+ "name": "identifier",
+ "in": "query",
+ "description": "An arbitrary identifier for the task",
+ "schema": {
+ "type": "string",
+ "default": ""
}
},
{
@@ -2839,7 +3164,7 @@
],
"responses": {
"200": {
- "description": "Collection returned",
+ "description": "Task scheduled successfully",
"content": {
"application/json": {
"schema": {
@@ -2859,7 +3184,15 @@
"$ref": "#/components/schemas/OCSMeta"
},
"data": {
- "$ref": "#/components/schemas/Collection"
+ "type": "object",
+ "required": [
+ "task"
+ ],
+ "properties": {
+ "task": {
+ "$ref": "#/components/schemas/TextProcessingTask"
+ }
+ }
}
}
}
@@ -2868,8 +3201,8 @@
}
}
},
- "404": {
- "description": "Collection not found",
+ "500": {
+ "description": "",
"content": {
"application/json": {
"schema": {
@@ -2888,7 +3221,17 @@
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
- "data": {}
+ "data": {
+ "type": "object",
+ "required": [
+ "message"
+ ],
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
}
}
}
@@ -2896,8 +3239,8 @@
}
}
},
- "500": {
- "description": "",
+ "400": {
+ "description": "Scheduling task is not possible",
"content": {
"application/json": {
"schema": {
@@ -2916,23 +3259,74 @@
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
- "data": {}
+ "data": {
+ "type": "object",
+ "required": [
+ "message"
+ ],
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
}
}
}
}
}
}
- }
- }
- },
- "put": {
- "operationId": "collaboration_resources-rename-collection",
- "summary": "Rename a collection",
- "tags": [
- "collaboration_resources"
- ],
- "security": [
+ },
+ "412": {
+ "description": "Scheduling task is not possible",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "ocs"
+ ],
+ "properties": {
+ "ocs": {
+ "type": "object",
+ "required": [
+ "meta",
+ "data"
+ ],
+ "properties": {
+ "meta": {
+ "$ref": "#/components/schemas/OCSMeta"
+ },
+ "data": {
+ "type": "object",
+ "required": [
+ "message"
+ ],
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/ocs/v2.php/textprocessing/task/{id}": {
+ "get": {
+ "operationId": "text_processing_api-get-task",
+ "summary": "This endpoint allows checking the status and results of a task. Tasks are removed 1 week after receiving their last update.",
+ "tags": [
+ "text_processing_api"
+ ],
+ "security": [
+ {},
{
"bearer_auth": []
},
@@ -2942,18 +3336,9 @@
],
"parameters": [
{
- "name": "collectionName",
- "in": "query",
- "description": "New name",
- "required": true,
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "collectionId",
+ "name": "id",
"in": "path",
- "description": "ID of the collection",
+ "description": "The id of the task",
"required": true,
"schema": {
"type": "integer",
@@ -2973,7 +3358,7 @@
],
"responses": {
"200": {
- "description": "Collection returned",
+ "description": "Task returned",
"content": {
"application/json": {
"schema": {
@@ -2993,7 +3378,15 @@
"$ref": "#/components/schemas/OCSMeta"
},
"data": {
- "$ref": "#/components/schemas/Collection"
+ "type": "object",
+ "required": [
+ "task"
+ ],
+ "properties": {
+ "task": {
+ "$ref": "#/components/schemas/TextProcessingTask"
+ }
+ }
}
}
}
@@ -3003,7 +3396,7 @@
}
},
"404": {
- "description": "Collection not found",
+ "description": "Task not found",
"content": {
"application/json": {
"schema": {
@@ -3022,7 +3415,17 @@
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
- "data": {}
+ "data": {
+ "type": "object",
+ "required": [
+ "message"
+ ],
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
}
}
}
@@ -3050,7 +3453,17 @@
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
- "data": {}
+ "data": {
+ "type": "object",
+ "required": [
+ "message"
+ ],
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
}
}
}
@@ -3060,11 +3473,11 @@
}
}
},
- "post": {
- "operationId": "collaboration_resources-add-resource",
- "summary": "Add a resource to a collection",
+ "delete": {
+ "operationId": "text_processing_api-delete-task",
+ "summary": "This endpoint allows to delete a scheduled task for a user",
"tags": [
- "collaboration_resources"
+ "text_processing_api"
],
"security": [
{
@@ -3076,27 +3489,9 @@
],
"parameters": [
{
- "name": "resourceType",
- "in": "query",
- "description": "Name of the resource",
- "required": true,
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "resourceId",
- "in": "query",
- "description": "ID of the resource",
- "required": true,
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "collectionId",
+ "name": "id",
"in": "path",
- "description": "ID of the collection",
+ "description": "The id of the task",
"required": true,
"schema": {
"type": "integer",
@@ -3116,7 +3511,7 @@
],
"responses": {
"200": {
- "description": "Collection returned",
+ "description": "Task returned",
"content": {
"application/json": {
"schema": {
@@ -3136,7 +3531,15 @@
"$ref": "#/components/schemas/OCSMeta"
},
"data": {
- "$ref": "#/components/schemas/Collection"
+ "type": "object",
+ "required": [
+ "task"
+ ],
+ "properties": {
+ "task": {
+ "$ref": "#/components/schemas/TextProcessingTask"
+ }
+ }
}
}
}
@@ -3146,7 +3549,7 @@
}
},
"404": {
- "description": "Collection not found or resource inaccessible",
+ "description": "Task not found",
"content": {
"application/json": {
"schema": {
@@ -3165,7 +3568,17 @@
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
- "data": {}
+ "data": {
+ "type": "object",
+ "required": [
+ "message"
+ ],
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
}
}
}
@@ -3193,7 +3606,17 @@
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
- "data": {}
+ "data": {
+ "type": "object",
+ "required": [
+ "message"
+ ],
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
}
}
}
@@ -3202,12 +3625,14 @@
}
}
}
- },
- "delete": {
- "operationId": "collaboration_resources-remove-resource",
- "summary": "Remove a resource from a collection",
+ }
+ },
+ "/ocs/v2.php/textprocessing/tasks/app/{appId}": {
+ "get": {
+ "operationId": "text_processing_api-list-tasks-by-app",
+ "summary": "This endpoint returns a list of tasks of a user that are related with a specific appId and optionally with an identifier",
"tags": [
- "collaboration_resources"
+ "text_processing_api"
],
"security": [
{
@@ -3219,31 +3644,21 @@
],
"parameters": [
{
- "name": "resourceType",
- "in": "query",
- "description": "Name of the resource",
- "required": true,
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "resourceId",
+ "name": "identifier",
"in": "query",
- "description": "ID of the resource",
- "required": true,
+ "description": "An arbitrary identifier for the task",
"schema": {
- "type": "string"
+ "type": "string",
+ "nullable": true
}
},
{
- "name": "collectionId",
+ "name": "appId",
"in": "path",
- "description": "ID of the collection",
+ "description": "ID of the app",
"required": true,
"schema": {
- "type": "integer",
- "format": "int64"
+ "type": "string"
}
},
{
@@ -3259,7 +3674,7 @@
],
"responses": {
"200": {
- "description": "Collection returned",
+ "description": "Task list returned",
"content": {
"application/json": {
"schema": {
@@ -3279,7 +3694,18 @@
"$ref": "#/components/schemas/OCSMeta"
},
"data": {
- "$ref": "#/components/schemas/Collection"
+ "type": "object",
+ "required": [
+ "tasks"
+ ],
+ "properties": {
+ "tasks": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/TextProcessingTask"
+ }
+ }
+ }
}
}
}
@@ -3288,8 +3714,8 @@
}
}
},
- "404": {
- "description": "Collection or resource not found",
+ "500": {
+ "description": "",
"content": {
"application/json": {
"schema": {
@@ -3308,18 +3734,60 @@
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
- "data": {}
+ "data": {
+ "type": "object",
+ "required": [
+ "message"
+ ],
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
}
}
}
}
}
}
+ }
+ }
+ }
+ },
+ "/ocs/v2.php/text2image/is_available": {
+ "get": {
+ "operationId": "text_to_image_api-is-available",
+ "summary": "Check whether this feature is available",
+ "tags": [
+ "text_to_image_api"
+ ],
+ "security": [
+ {},
+ {
+ "bearer_auth": []
},
- "500": {
- "description": "",
- "content": {
- "application/json": {
+ {
+ "basic_auth": []
+ }
+ ],
+ "parameters": [
+ {
+ "name": "OCS-APIRequest",
+ "in": "header",
+ "description": "Required to be true for the API request to pass",
+ "required": true,
+ "schema": {
+ "type": "boolean",
+ "default": true
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Returns availability status",
+ "content": {
+ "application/json": {
"schema": {
"type": "object",
"required": [
@@ -3336,7 +3804,17 @@
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
- "data": {}
+ "data": {
+ "type": "object",
+ "required": [
+ "isAvailable"
+ ],
+ "properties": {
+ "isAvailable": {
+ "type": "boolean"
+ }
+ }
+ }
}
}
}
@@ -3347,14 +3825,15 @@
}
}
},
- "/ocs/v2.php/collaboration/resources/{resourceType}/{resourceId}": {
- "get": {
- "operationId": "collaboration_resources-get-collections-by-resource",
- "summary": "Get collections by resource",
+ "/ocs/v2.php/text2image/schedule": {
+ "post": {
+ "operationId": "text_to_image_api-schedule",
+ "summary": "This endpoint allows scheduling a text to image task",
"tags": [
- "collaboration_resources"
+ "text_to_image_api"
],
"security": [
+ {},
{
"bearer_auth": []
},
@@ -3364,23 +3843,42 @@
],
"parameters": [
{
- "name": "resourceType",
- "in": "path",
- "description": "Type of the resource",
+ "name": "input",
+ "in": "query",
+ "description": "Input text",
"required": true,
"schema": {
"type": "string"
}
},
{
- "name": "resourceId",
- "in": "path",
- "description": "ID of the resource",
+ "name": "appId",
+ "in": "query",
+ "description": "ID of the app that will execute the task",
"required": true,
"schema": {
"type": "string"
}
},
+ {
+ "name": "identifier",
+ "in": "query",
+ "description": "An arbitrary identifier for the task",
+ "schema": {
+ "type": "string",
+ "default": ""
+ }
+ },
+ {
+ "name": "numberOfImages",
+ "in": "query",
+ "description": "The number of images to generate",
+ "schema": {
+ "type": "integer",
+ "format": "int64",
+ "default": 8
+ }
+ },
{
"name": "OCS-APIRequest",
"in": "header",
@@ -3394,7 +3892,7 @@
],
"responses": {
"200": {
- "description": "Collections returned",
+ "description": "Task scheduled successfully",
"content": {
"application/json": {
"schema": {
@@ -3414,9 +3912,14 @@
"$ref": "#/components/schemas/OCSMeta"
},
"data": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/Collection"
+ "type": "object",
+ "required": [
+ "task"
+ ],
+ "properties": {
+ "task": {
+ "$ref": "#/components/schemas/TextToImageTask"
+ }
}
}
}
@@ -3426,8 +3929,8 @@
}
}
},
- "404": {
- "description": "Resource not accessible",
+ "412": {
+ "description": "Scheduling task is not possible",
"content": {
"application/json": {
"schema": {
@@ -3446,7 +3949,55 @@
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
- "data": {}
+ "data": {
+ "type": "object",
+ "required": [
+ "message"
+ ],
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "ocs"
+ ],
+ "properties": {
+ "ocs": {
+ "type": "object",
+ "required": [
+ "meta",
+ "data"
+ ],
+ "properties": {
+ "meta": {
+ "$ref": "#/components/schemas/OCSMeta"
+ },
+ "data": {
+ "type": "object",
+ "required": [
+ "message"
+ ],
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
}
}
}
@@ -3457,14 +4008,15 @@
}
}
},
- "/ocs/v2.php/collaboration/resources/{baseResourceType}/{baseResourceId}": {
- "post": {
- "operationId": "collaboration_resources-create-collection-on-resource",
- "summary": "Create a collection for a resource",
+ "/ocs/v2.php/text2image/task/{id}": {
+ "get": {
+ "operationId": "text_to_image_api-get-task",
+ "summary": "This endpoint allows checking the status and results of a task. Tasks are removed 1 week after receiving their last update.",
"tags": [
- "collaboration_resources"
+ "text_to_image_api"
],
"security": [
+ {},
{
"bearer_auth": []
},
@@ -3474,30 +4026,13 @@
],
"parameters": [
{
- "name": "name",
- "in": "query",
- "description": "Name of the collection",
- "required": true,
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "baseResourceType",
- "in": "path",
- "description": "Type of the base resource",
- "required": true,
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "baseResourceId",
+ "name": "id",
"in": "path",
- "description": "ID of the base resource",
+ "description": "The id of the task",
"required": true,
"schema": {
- "type": "string"
+ "type": "integer",
+ "format": "int64"
}
},
{
@@ -3513,7 +4048,7 @@
],
"responses": {
"200": {
- "description": "Collection returned",
+ "description": "Task returned",
"content": {
"application/json": {
"schema": {
@@ -3533,7 +4068,15 @@
"$ref": "#/components/schemas/OCSMeta"
},
"data": {
- "$ref": "#/components/schemas/Collection"
+ "type": "object",
+ "required": [
+ "task"
+ ],
+ "properties": {
+ "task": {
+ "$ref": "#/components/schemas/TextToImageTask"
+ }
+ }
}
}
}
@@ -3542,36 +4085,8 @@
}
}
},
- "400": {
- "description": "Creating collection is not possible",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "required": [
- "ocs"
- ],
- "properties": {
- "ocs": {
- "type": "object",
- "required": [
- "meta",
- "data"
- ],
- "properties": {
- "meta": {
- "$ref": "#/components/schemas/OCSMeta"
- },
- "data": {}
- }
- }
- }
- }
- }
- }
- },
"404": {
- "description": "Resource inaccessible",
+ "description": "Task not found",
"content": {
"application/json": {
"schema": {
@@ -3590,7 +4105,17 @@
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
- "data": {}
+ "data": {
+ "type": "object",
+ "required": [
+ "message"
+ ],
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
}
}
}
@@ -3618,7 +4143,17 @@
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
- "data": {}
+ "data": {
+ "type": "object",
+ "required": [
+ "message"
+ ],
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
}
}
}
@@ -3627,14 +4162,12 @@
}
}
}
- }
- },
- "/ocs/v2.php/references/resolve": {
- "get": {
- "operationId": "reference_api-resolve-one",
- "summary": "Resolve a reference",
+ },
+ "delete": {
+ "operationId": "text_to_image_api-delete-task",
+ "summary": "This endpoint allows to delete a scheduled task for a user",
"tags": [
- "reference_api"
+ "text_to_image_api"
],
"security": [
{
@@ -3646,12 +4179,13 @@
],
"parameters": [
{
- "name": "reference",
- "in": "query",
- "description": "Reference to resolve",
+ "name": "id",
+ "in": "path",
+ "description": "The id of the task",
"required": true,
"schema": {
- "type": "string"
+ "type": "integer",
+ "format": "int64"
}
},
{
@@ -3667,7 +4201,7 @@
],
"responses": {
"200": {
- "description": "Reference returned",
+ "description": "Task returned",
"content": {
"application/json": {
"schema": {
@@ -3689,15 +4223,11 @@
"data": {
"type": "object",
"required": [
- "references"
+ "task"
],
"properties": {
- "references": {
- "type": "object",
- "additionalProperties": {
- "$ref": "#/components/schemas/Reference",
- "nullable": true
- }
+ "task": {
+ "$ref": "#/components/schemas/TextToImageTask"
}
}
}
@@ -3707,60 +4237,47 @@
}
}
}
- }
- }
- },
- "post": {
- "operationId": "reference_api-resolve",
- "summary": "Resolve multiple references",
- "tags": [
- "reference_api"
- ],
- "security": [
- {
- "bearer_auth": []
},
- {
- "basic_auth": []
- }
- ],
- "parameters": [
- {
- "name": "references[]",
- "in": "query",
- "description": "References to resolve",
- "required": true,
- "schema": {
- "type": "array",
- "items": {
- "type": "string"
+ "404": {
+ "description": "Task not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "ocs"
+ ],
+ "properties": {
+ "ocs": {
+ "type": "object",
+ "required": [
+ "meta",
+ "data"
+ ],
+ "properties": {
+ "meta": {
+ "$ref": "#/components/schemas/OCSMeta"
+ },
+ "data": {
+ "type": "object",
+ "required": [
+ "message"
+ ],
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
}
}
},
- {
- "name": "limit",
- "in": "query",
- "description": "Maximum amount of references to resolve",
- "schema": {
- "type": "integer",
- "format": "int64",
- "default": 1
- }
- },
- {
- "name": "OCS-APIRequest",
- "in": "header",
- "description": "Required to be true for the API request to pass",
- "required": true,
- "schema": {
- "type": "boolean",
- "default": true
- }
- }
- ],
- "responses": {
- "200": {
- "description": "References returned",
+ "500": {
+ "description": "",
"content": {
"application/json": {
"schema": {
@@ -3782,15 +4299,11 @@
"data": {
"type": "object",
"required": [
- "references"
+ "message"
],
"properties": {
- "references": {
- "type": "object",
- "additionalProperties": {
- "$ref": "#/components/schemas/Reference",
- "nullable": true
- }
+ "message": {
+ "type": "string"
}
}
}
@@ -3804,14 +4317,15 @@
}
}
},
- "/ocs/v2.php/references/extract": {
- "post": {
- "operationId": "reference_api-extract",
- "summary": "Extract references from a text",
+ "/ocs/v2.php/text2image/task/{id}/image/{index}": {
+ "get": {
+ "operationId": "text_to_image_api-get-image",
+ "summary": "This endpoint allows downloading the resulting image of a task",
"tags": [
- "reference_api"
+ "text_to_image_api"
],
"security": [
+ {},
{
"bearer_auth": []
},
@@ -3821,35 +4335,23 @@
],
"parameters": [
{
- "name": "text",
- "in": "query",
- "description": "Text to extract from",
+ "name": "id",
+ "in": "path",
+ "description": "The id of the task",
"required": true,
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "resolve",
- "in": "query",
- "description": "Resolve the references",
"schema": {
"type": "integer",
- "default": 0,
- "enum": [
- 0,
- 1
- ]
+ "format": "int64"
}
},
{
- "name": "limit",
- "in": "query",
- "description": "Maximum amount of references to extract",
+ "name": "index",
+ "in": "path",
+ "description": "The index of the image to retrieve",
+ "required": true,
"schema": {
"type": "integer",
- "format": "int64",
- "default": 1
+ "format": "int64"
}
},
{
@@ -3865,7 +4367,18 @@
],
"responses": {
"200": {
- "description": "References returned",
+ "description": "Image returned",
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "string",
+ "format": "binary"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Task or image not found",
"content": {
"application/json": {
"schema": {
@@ -3887,15 +4400,11 @@
"data": {
"type": "object",
"required": [
- "references"
+ "message"
],
"properties": {
- "references": {
- "type": "object",
- "additionalProperties": {
- "$ref": "#/components/schemas/Reference",
- "nullable": true
- }
+ "message": {
+ "type": "string"
}
}
}
@@ -3905,40 +4414,9 @@
}
}
}
- }
- }
- }
- },
- "/ocs/v2.php/references/providers": {
- "get": {
- "operationId": "reference_api-get-providers-info",
- "summary": "Get the providers",
- "tags": [
- "reference_api"
- ],
- "security": [
- {
- "bearer_auth": []
},
- {
- "basic_auth": []
- }
- ],
- "parameters": [
- {
- "name": "OCS-APIRequest",
- "in": "header",
- "description": "Required to be true for the API request to pass",
- "required": true,
- "schema": {
- "type": "boolean",
- "default": true
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Providers returned",
+ "500": {
+ "description": "",
"content": {
"application/json": {
"schema": {
@@ -3958,9 +4436,14 @@
"$ref": "#/components/schemas/OCSMeta"
},
"data": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/ReferenceProvider"
+ "type": "object",
+ "required": [
+ "message"
+ ],
+ "properties": {
+ "message": {
+ "type": "string"
+ }
}
}
}
@@ -3973,12 +4456,12 @@
}
}
},
- "/ocs/v2.php/references/provider/{providerId}": {
- "put": {
- "operationId": "reference_api-touch-provider",
- "summary": "Touch a provider",
+ "/ocs/v2.php/text2image/tasks/app/{appId}": {
+ "get": {
+ "operationId": "text_to_image_api-list-tasks-by-app",
+ "summary": "This endpoint returns a list of tasks of a user that are related with a specific appId and optionally with an identifier",
"tags": [
- "reference_api"
+ "text_to_image_api"
],
"security": [
{
@@ -3990,19 +4473,18 @@
],
"parameters": [
{
- "name": "timestamp",
+ "name": "identifier",
"in": "query",
- "description": "Timestamp of the last usage",
+ "description": "An arbitrary identifier for the task",
"schema": {
- "type": "integer",
- "format": "int64",
+ "type": "string",
"nullable": true
}
},
{
- "name": "providerId",
+ "name": "appId",
"in": "path",
- "description": "ID of the provider",
+ "description": "ID of the app",
"required": true,
"schema": {
"type": "string"
@@ -4021,7 +4503,7 @@
],
"responses": {
"200": {
- "description": "Provider touched",
+ "description": "Task list returned",
"content": {
"application/json": {
"schema": {
@@ -4043,12 +4525,15 @@
"data": {
"type": "object",
"required": [
- "success"
+ "tasks"
],
"properties": {
- "success": {
- "type": "boolean"
- }
+ "tasks": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/TextToImageTask"
+ }
+ }
}
}
}
@@ -4057,67 +4542,9 @@
}
}
}
- }
- }
- }
- },
- "/ocs/v2.php/profile/{targetUserId}": {
- "put": {
- "operationId": "profile_api-set-visibility",
- "summary": "Update the visibility of a parameter",
- "tags": [
- "profile_api"
- ],
- "security": [
- {
- "bearer_auth": []
- },
- {
- "basic_auth": []
- }
- ],
- "parameters": [
- {
- "name": "paramId",
- "in": "query",
- "description": "ID of the parameter",
- "required": true,
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "visibility",
- "in": "query",
- "description": "New visibility",
- "required": true,
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "targetUserId",
- "in": "path",
- "description": "ID of the user",
- "required": true,
- "schema": {
- "type": "string"
- }
},
- {
- "name": "OCS-APIRequest",
- "in": "header",
- "description": "Required to be true for the API request to pass",
- "required": true,
- "schema": {
- "type": "boolean",
- "default": true
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Visibility updated successfully",
+ "500": {
+ "description": "",
"content": {
"application/json": {
"schema": {
@@ -4136,55 +4563,36 @@
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
- "data": {}
+ "data": {
+ "type": "object",
+ "required": [
+ "message"
+ ],
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
}
}
}
}
}
}
- },
- "400": {
- "description": "Updating visibility is not possible",
- "content": {
- "text/plain": {
- "schema": {
- "type": "string"
- }
- }
- }
- },
- "403": {
- "description": "Not allowed to edit other users visibility",
- "content": {
- "text/plain": {
- "schema": {
- "type": "string"
- }
- }
- }
- },
- "404": {
- "description": "Account not found",
- "content": {
- "text/plain": {
- "schema": {
- "type": "string"
- }
- }
- }
}
}
}
},
- "/ocs/v2.php/search/providers": {
+ "/ocs/v2.php/translation/languages": {
"get": {
- "operationId": "unified_search-get-providers",
- "summary": "Get the providers for unified search",
+ "operationId": "translation_api-languages",
+ "summary": "Get the list of supported languages",
"tags": [
- "unified_search"
+ "translation_api"
],
"security": [
+ {},
{
"bearer_auth": []
},
@@ -4193,15 +4601,6 @@
}
],
"parameters": [
- {
- "name": "from",
- "in": "query",
- "description": "the url the user is currently at",
- "schema": {
- "type": "string",
- "default": ""
- }
- },
{
"name": "OCS-APIRequest",
"in": "header",
@@ -4215,7 +4614,7 @@
],
"responses": {
"200": {
- "description": "Providers returned",
+ "description": "Supported languages returned",
"content": {
"application/json": {
"schema": {
@@ -4235,9 +4634,41 @@
"$ref": "#/components/schemas/OCSMeta"
},
"data": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/UnifiedSearchProvider"
+ "type": "object",
+ "required": [
+ "languages",
+ "languageDetection"
+ ],
+ "properties": {
+ "languages": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "required": [
+ "from",
+ "fromLabel",
+ "to",
+ "toLabel"
+ ],
+ "properties": {
+ "from": {
+ "type": "string"
+ },
+ "fromLabel": {
+ "type": "string"
+ },
+ "to": {
+ "type": "string"
+ },
+ "toLabel": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "languageDetection": {
+ "type": "boolean"
+ }
}
}
}
@@ -4250,15 +4681,15 @@
}
}
},
- "/ocs/v2.php/search/providers/{providerId}/search": {
- "get": {
- "operationId": "unified_search-search",
- "summary": "Launch a search for a specific search provider.",
- "description": "Additional filters are available for each provider. Send a request to /providers endpoint to list providers with their available filters.",
+ "/ocs/v2.php/translation/translate": {
+ "post": {
+ "operationId": "translation_api-translate",
+ "summary": "Translate a text",
"tags": [
- "unified_search"
+ "translation_api"
],
"security": [
+ {},
{
"bearer_auth": []
},
@@ -4268,64 +4699,27 @@
],
"parameters": [
{
- "name": "term",
- "in": "query",
- "description": "Term to search",
- "schema": {
- "type": "string",
- "default": ""
- }
- },
- {
- "name": "sortOrder",
+ "name": "text",
"in": "query",
- "description": "Order of entries",
+ "description": "Text to be translated",
+ "required": true,
"schema": {
- "type": "integer",
- "format": "int64",
- "nullable": true
+ "type": "string"
}
},
{
- "name": "limit",
+ "name": "fromLanguage",
"in": "query",
- "description": "Maximum amount of entries",
+ "description": "Language to translate from",
"schema": {
- "type": "integer",
- "format": "int64",
+ "type": "string",
"nullable": true
}
},
{
- "name": "cursor",
- "in": "query",
- "description": "Offset for searching",
- "schema": {
- "nullable": true,
- "oneOf": [
- {
- "type": "integer",
- "format": "int64"
- },
- {
- "type": "string"
- }
- ]
- }
- },
- {
- "name": "from",
+ "name": "toLanguage",
"in": "query",
- "description": "The current user URL",
- "schema": {
- "type": "string",
- "default": ""
- }
- },
- {
- "name": "providerId",
- "in": "path",
- "description": "ID of the provider",
+ "description": "Language to translate to",
"required": true,
"schema": {
"type": "string"
@@ -4344,7 +4738,7 @@
],
"responses": {
"200": {
- "description": "Search entries returned",
+ "description": "Translated text returned",
"content": {
"application/json": {
"schema": {
@@ -4364,7 +4758,20 @@
"$ref": "#/components/schemas/OCSMeta"
},
"data": {
- "$ref": "#/components/schemas/UnifiedSearchResult"
+ "type": "object",
+ "required": [
+ "text",
+ "from"
+ ],
+ "properties": {
+ "text": {
+ "type": "string"
+ },
+ "from": {
+ "type": "string",
+ "nullable": true
+ }
+ }
}
}
}
@@ -4374,7 +4781,7 @@
}
},
"400": {
- "description": "Searching is not possible",
+ "description": "Language not detected or unable to translate",
"content": {
"application/json": {
"schema": {
@@ -4394,8 +4801,104 @@
"$ref": "#/components/schemas/OCSMeta"
},
"data": {
- "type": "string"
- }
+ "type": "object",
+ "required": [
+ "message"
+ ],
+ "properties": {
+ "message": {
+ "type": "string"
+ },
+ "from": {
+ "type": "string",
+ "nullable": true
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "412": {
+ "description": "Translating is not possible",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "ocs"
+ ],
+ "properties": {
+ "ocs": {
+ "type": "object",
+ "required": [
+ "meta",
+ "data"
+ ],
+ "properties": {
+ "meta": {
+ "$ref": "#/components/schemas/OCSMeta"
+ },
+ "data": {
+ "type": "object",
+ "required": [
+ "message"
+ ],
+ "properties": {
+ "message": {
+ "type": "string"
+ },
+ "from": {
+ "type": "string",
+ "nullable": true
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "ocs"
+ ],
+ "properties": {
+ "ocs": {
+ "type": "object",
+ "required": [
+ "meta",
+ "data"
+ ],
+ "properties": {
+ "meta": {
+ "$ref": "#/components/schemas/OCSMeta"
+ },
+ "data": {
+ "type": "object",
+ "required": [
+ "message"
+ ],
+ "properties": {
+ "message": {
+ "type": "string"
+ },
+ "from": {
+ "type": "string",
+ "nullable": true
+ }
+ }
+ }
}
}
}
@@ -4406,15 +4909,14 @@
}
}
},
- "/ocs/v2.php/translation/languages": {
+ "/ocs/v2.php/search/providers": {
"get": {
- "operationId": "translation_api-languages",
- "summary": "Get the list of supported languages",
+ "operationId": "unified_search-get-providers",
+ "summary": "Get the providers for unified search",
"tags": [
- "translation_api"
+ "unified_search"
],
"security": [
- {},
{
"bearer_auth": []
},
@@ -4423,6 +4925,15 @@
}
],
"parameters": [
+ {
+ "name": "from",
+ "in": "query",
+ "description": "the url the user is currently at",
+ "schema": {
+ "type": "string",
+ "default": ""
+ }
+ },
{
"name": "OCS-APIRequest",
"in": "header",
@@ -4436,7 +4947,7 @@
],
"responses": {
"200": {
- "description": "Supported languages returned",
+ "description": "Providers returned",
"content": {
"application/json": {
"schema": {
@@ -4456,41 +4967,9 @@
"$ref": "#/components/schemas/OCSMeta"
},
"data": {
- "type": "object",
- "required": [
- "languages",
- "languageDetection"
- ],
- "properties": {
- "languages": {
- "type": "array",
- "items": {
- "type": "object",
- "required": [
- "from",
- "fromLabel",
- "to",
- "toLabel"
- ],
- "properties": {
- "from": {
- "type": "string"
- },
- "fromLabel": {
- "type": "string"
- },
- "to": {
- "type": "string"
- },
- "toLabel": {
- "type": "string"
- }
- }
- }
- },
- "languageDetection": {
- "type": "boolean"
- }
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/UnifiedSearchProvider"
}
}
}
@@ -4503,15 +4982,15 @@
}
}
},
- "/ocs/v2.php/translation/translate": {
- "post": {
- "operationId": "translation_api-translate",
- "summary": "Translate a text",
+ "/ocs/v2.php/search/providers/{providerId}/search": {
+ "get": {
+ "operationId": "unified_search-search",
+ "summary": "Launch a search for a specific search provider.",
+ "description": "Additional filters are available for each provider. Send a request to /providers endpoint to list providers with their available filters.",
"tags": [
- "translation_api"
+ "unified_search"
],
"security": [
- {},
{
"bearer_auth": []
},
@@ -4521,27 +5000,64 @@
],
"parameters": [
{
- "name": "text",
+ "name": "term",
"in": "query",
- "description": "Text to be translated",
- "required": true,
+ "description": "Term to search",
"schema": {
- "type": "string"
+ "type": "string",
+ "default": ""
}
},
{
- "name": "fromLanguage",
+ "name": "sortOrder",
"in": "query",
- "description": "Language to translate from",
+ "description": "Order of entries",
"schema": {
- "type": "string",
+ "type": "integer",
+ "format": "int64",
"nullable": true
}
},
{
- "name": "toLanguage",
+ "name": "limit",
"in": "query",
- "description": "Language to translate to",
+ "description": "Maximum amount of entries",
+ "schema": {
+ "type": "integer",
+ "format": "int64",
+ "nullable": true
+ }
+ },
+ {
+ "name": "cursor",
+ "in": "query",
+ "description": "Offset for searching",
+ "schema": {
+ "nullable": true,
+ "oneOf": [
+ {
+ "type": "integer",
+ "format": "int64"
+ },
+ {
+ "type": "string"
+ }
+ ]
+ }
+ },
+ {
+ "name": "from",
+ "in": "query",
+ "description": "The current user URL",
+ "schema": {
+ "type": "string",
+ "default": ""
+ }
+ },
+ {
+ "name": "providerId",
+ "in": "path",
+ "description": "ID of the provider",
"required": true,
"schema": {
"type": "string"
@@ -4560,7 +5076,7 @@
],
"responses": {
"200": {
- "description": "Translated text returned",
+ "description": "Search entries returned",
"content": {
"application/json": {
"schema": {
@@ -4580,20 +5096,7 @@
"$ref": "#/components/schemas/OCSMeta"
},
"data": {
- "type": "object",
- "required": [
- "text",
- "from"
- ],
- "properties": {
- "text": {
- "type": "string"
- },
- "from": {
- "type": "string",
- "nullable": true
- }
- }
+ "$ref": "#/components/schemas/UnifiedSearchResult"
}
}
}
@@ -4603,7 +5106,7 @@
}
},
"400": {
- "description": "Language not detected or unable to translate",
+ "description": "Searching is not possible",
"content": {
"application/json": {
"schema": {
@@ -4623,19 +5126,7 @@
"$ref": "#/components/schemas/OCSMeta"
},
"data": {
- "type": "object",
- "required": [
- "message"
- ],
- "properties": {
- "message": {
- "type": "string"
- },
- "from": {
- "type": "string",
- "nullable": true
- }
- }
+ "type": "string"
}
}
}
@@ -4643,9 +5134,40 @@
}
}
}
+ }
+ }
+ }
+ },
+ "/ocs/v2.php/core/whatsnew": {
+ "get": {
+ "operationId": "whats_new-get",
+ "summary": "Get the changes",
+ "tags": [
+ "whats_new"
+ ],
+ "security": [
+ {
+ "bearer_auth": []
},
- "412": {
- "description": "Translating is not possible",
+ {
+ "basic_auth": []
+ }
+ ],
+ "parameters": [
+ {
+ "name": "OCS-APIRequest",
+ "in": "header",
+ "description": "Required to be true for the API request to pass",
+ "required": true,
+ "schema": {
+ "type": "boolean",
+ "default": true
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Changes returned",
"content": {
"application/json": {
"schema": {
@@ -4667,15 +5189,40 @@
"data": {
"type": "object",
"required": [
- "message"
+ "changelogURL",
+ "product",
+ "version"
],
"properties": {
- "message": {
+ "changelogURL": {
"type": "string"
},
- "from": {
- "type": "string",
- "nullable": true
+ "product": {
+ "type": "string"
+ },
+ "version": {
+ "type": "string"
+ },
+ "whatsNew": {
+ "type": "object",
+ "required": [
+ "regular",
+ "admin"
+ ],
+ "properties": {
+ "regular": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "admin": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
}
}
}
@@ -4686,8 +5233,8 @@
}
}
},
- "500": {
- "description": "",
+ "204": {
+ "description": "No changes",
"content": {
"application/json": {
"schema": {
@@ -4706,21 +5253,7 @@
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
- "data": {
- "type": "object",
- "required": [
- "message"
- ],
- "properties": {
- "message": {
- "type": "string"
- },
- "from": {
- "type": "string",
- "nullable": true
- }
- }
- }
+ "data": {}
}
}
}
@@ -4729,17 +5262,14 @@
}
}
}
- }
- },
- "/ocs/v2.php/textprocessing/tasktypes": {
- "get": {
- "operationId": "text_processing_api-task-types",
- "summary": "This endpoint returns all available LanguageModel task types",
+ },
+ "post": {
+ "operationId": "whats_new-dismiss",
+ "summary": "Dismiss the changes",
"tags": [
- "text_processing_api"
+ "whats_new"
],
"security": [
- {},
{
"bearer_auth": []
},
@@ -4748,6 +5278,15 @@
}
],
"parameters": [
+ {
+ "name": "version",
+ "in": "query",
+ "description": "Version to dismiss the changes for",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ },
{
"name": "OCS-APIRequest",
"in": "header",
@@ -4761,7 +5300,7 @@
],
"responses": {
"200": {
- "description": "Task types returned",
+ "description": "Changes dismissed",
"content": {
"application/json": {
"schema": {
@@ -4780,52 +5319,33 @@
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
- "data": {
- "type": "object",
- "required": [
- "types"
- ],
- "properties": {
- "types": {
- "type": "array",
- "items": {
- "type": "object",
- "required": [
- "id",
- "name",
- "description"
- ],
- "properties": {
- "id": {
- "type": "string"
- },
- "name": {
- "type": "string"
- },
- "description": {
- "type": "string"
- }
- }
- }
- }
- }
- }
+ "data": {}
}
}
}
}
}
}
+ },
+ "500": {
+ "description": "",
+ "content": {
+ "text/plain": {
+ "schema": {
+ "type": "string"
+ }
+ }
+ }
}
}
}
},
- "/ocs/v2.php/textprocessing/schedule": {
- "post": {
- "operationId": "text_processing_api-schedule",
- "summary": "This endpoint allows scheduling a language model task",
+ "/index.php/avatar/{userId}/{size}/dark": {
+ "get": {
+ "operationId": "avatar-get-avatar-dark",
+ "summary": "Get the dark avatar",
"tags": [
- "text_processing_api"
+ "avatar"
],
"security": [
{},
@@ -4838,201 +5358,196 @@
],
"parameters": [
{
- "name": "input",
- "in": "query",
- "description": "Input text",
+ "name": "userId",
+ "in": "path",
+ "description": "ID of the user",
"required": true,
"schema": {
"type": "string"
}
},
{
- "name": "type",
- "in": "query",
- "description": "Type of the task",
+ "name": "size",
+ "in": "path",
+ "description": "Size of the avatar",
"required": true,
"schema": {
- "type": "string"
+ "type": "integer",
+ "format": "int64"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Avatar returned",
+ "headers": {
+ "X-NC-IsCustomAvatar": {
+ "schema": {
+ "type": "integer",
+ "format": "int64"
+ }
+ }
+ },
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "string",
+ "format": "binary"
+ }
+ }
}
},
- {
- "name": "appId",
- "in": "query",
- "description": "ID of the app that will execute the task",
- "required": true,
- "schema": {
- "type": "string"
+ "404": {
+ "description": "Avatar not found",
+ "content": {
+ "application/json": {
+ "schema": {}
+ }
}
+ }
+ }
+ }
+ },
+ "/index.php/avatar/{userId}/{size}": {
+ "get": {
+ "operationId": "avatar-get-avatar",
+ "summary": "Get the avatar",
+ "tags": [
+ "avatar"
+ ],
+ "security": [
+ {},
+ {
+ "bearer_auth": []
},
{
- "name": "identifier",
- "in": "query",
- "description": "An arbitrary identifier for the task",
+ "basic_auth": []
+ }
+ ],
+ "parameters": [
+ {
+ "name": "userId",
+ "in": "path",
+ "description": "ID of the user",
+ "required": true,
"schema": {
- "type": "string",
- "default": ""
+ "type": "string"
}
},
{
- "name": "OCS-APIRequest",
- "in": "header",
- "description": "Required to be true for the API request to pass",
+ "name": "size",
+ "in": "path",
+ "description": "Size of the avatar",
"required": true,
"schema": {
- "type": "boolean",
- "default": true
+ "type": "integer",
+ "format": "int64"
}
}
],
"responses": {
"200": {
- "description": "Task scheduled successfully",
- "content": {
- "application/json": {
+ "description": "Avatar returned",
+ "headers": {
+ "X-NC-IsCustomAvatar": {
"schema": {
- "type": "object",
- "required": [
- "ocs"
- ],
- "properties": {
- "ocs": {
- "type": "object",
- "required": [
- "meta",
- "data"
- ],
- "properties": {
- "meta": {
- "$ref": "#/components/schemas/OCSMeta"
- },
- "data": {
- "type": "object",
- "required": [
- "task"
- ],
- "properties": {
- "task": {
- "$ref": "#/components/schemas/TextProcessingTask"
- }
- }
- }
- }
- }
- }
+ "type": "integer",
+ "format": "int64"
+ }
+ }
+ },
+ "content": {
+ "*/*": {
+ "schema": {
+ "type": "string",
+ "format": "binary"
}
}
}
},
- "500": {
- "description": "",
+ "404": {
+ "description": "Avatar not found",
"content": {
"application/json": {
- "schema": {
- "type": "object",
- "required": [
- "ocs"
- ],
- "properties": {
- "ocs": {
- "type": "object",
- "required": [
- "meta",
- "data"
- ],
- "properties": {
- "meta": {
- "$ref": "#/components/schemas/OCSMeta"
- },
- "data": {
- "type": "object",
- "required": [
- "message"
- ],
- "properties": {
- "message": {
- "type": "string"
- }
- }
- }
- }
- }
- }
- }
+ "schema": {}
}
}
+ }
+ }
+ }
+ },
+ "/index.php/login/v2/poll": {
+ "post": {
+ "operationId": "client_flow_login_v2-poll",
+ "summary": "Poll the login flow credentials",
+ "tags": [
+ "client_flow_login_v2"
+ ],
+ "security": [
+ {},
+ {
+ "bearer_auth": []
},
- "400": {
- "description": "Scheduling task is not possible",
+ {
+ "basic_auth": []
+ }
+ ],
+ "parameters": [
+ {
+ "name": "token",
+ "in": "query",
+ "description": "Token of the flow",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Login flow credentials returned",
"content": {
"application/json": {
"schema": {
- "type": "object",
- "required": [
- "ocs"
- ],
- "properties": {
- "ocs": {
- "type": "object",
- "required": [
- "meta",
- "data"
- ],
- "properties": {
- "meta": {
- "$ref": "#/components/schemas/OCSMeta"
- },
- "data": {
- "type": "object",
- "required": [
- "message"
- ],
- "properties": {
- "message": {
- "type": "string"
- }
- }
- }
- }
- }
- }
+ "$ref": "#/components/schemas/LoginFlowV2Credentials"
}
}
}
},
- "412": {
- "description": "Scheduling task is not possible",
+ "404": {
+ "description": "Login flow not found or completed",
+ "content": {
+ "application/json": {
+ "schema": {}
+ }
+ }
+ }
+ }
+ }
+ },
+ "/index.php/login/v2": {
+ "post": {
+ "operationId": "client_flow_login_v2-init",
+ "summary": "Init a login flow",
+ "tags": [
+ "client_flow_login_v2"
+ ],
+ "security": [
+ {},
+ {
+ "bearer_auth": []
+ },
+ {
+ "basic_auth": []
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Login flow init returned",
"content": {
"application/json": {
"schema": {
- "type": "object",
- "required": [
- "ocs"
- ],
- "properties": {
- "ocs": {
- "type": "object",
- "required": [
- "meta",
- "data"
- ],
- "properties": {
- "meta": {
- "$ref": "#/components/schemas/OCSMeta"
- },
- "data": {
- "type": "object",
- "required": [
- "message"
- ],
- "properties": {
- "message": {
- "type": "string"
- }
- }
- }
- }
- }
- }
+ "$ref": "#/components/schemas/LoginFlowV2"
}
}
}
@@ -5040,12 +5555,12 @@
}
}
},
- "/ocs/v2.php/textprocessing/task/{id}": {
+ "/index.php/avatar/guest/{guestName}/{size}": {
"get": {
- "operationId": "text_processing_api-get-task",
- "summary": "This endpoint allows checking the status and results of a task. Tasks are removed 1 week after receiving their last update.",
+ "operationId": "guest_avatar-get-avatar",
+ "summary": "Returns a guest avatar image response",
"tags": [
- "text_processing_api"
+ "guest_avatar"
],
"security": [
{},
@@ -5058,150 +5573,76 @@
],
"parameters": [
{
- "name": "id",
+ "name": "darkTheme",
+ "in": "query",
+ "description": "Return dark avatar",
+ "schema": {
+ "type": "integer",
+ "nullable": true,
+ "default": 0,
+ "enum": [
+ 0,
+ 1
+ ]
+ }
+ },
+ {
+ "name": "guestName",
"in": "path",
- "description": "The id of the task",
+ "description": "The guest name, e.g. \"Albert\"",
"required": true,
"schema": {
- "type": "integer",
- "format": "int64"
+ "type": "string"
}
},
{
- "name": "OCS-APIRequest",
- "in": "header",
- "description": "Required to be true for the API request to pass",
+ "name": "size",
+ "in": "path",
+ "description": "The desired avatar size, e.g. 64 for 64x64px",
"required": true,
"schema": {
- "type": "boolean",
- "default": true
+ "type": "string"
}
}
],
"responses": {
"200": {
- "description": "Task returned",
+ "description": "Custom avatar returned",
"content": {
- "application/json": {
+ "*/*": {
"schema": {
- "type": "object",
- "required": [
- "ocs"
- ],
- "properties": {
- "ocs": {
- "type": "object",
- "required": [
- "meta",
- "data"
- ],
- "properties": {
- "meta": {
- "$ref": "#/components/schemas/OCSMeta"
- },
- "data": {
- "type": "object",
- "required": [
- "task"
- ],
- "properties": {
- "task": {
- "$ref": "#/components/schemas/TextProcessingTask"
- }
- }
- }
- }
- }
- }
+ "type": "string",
+ "format": "binary"
}
}
}
},
- "404": {
- "description": "Task not found",
+ "201": {
+ "description": "Avatar returned",
"content": {
- "application/json": {
+ "*/*": {
"schema": {
- "type": "object",
- "required": [
- "ocs"
- ],
- "properties": {
- "ocs": {
- "type": "object",
- "required": [
- "meta",
- "data"
- ],
- "properties": {
- "meta": {
- "$ref": "#/components/schemas/OCSMeta"
- },
- "data": {
- "type": "object",
- "required": [
- "message"
- ],
- "properties": {
- "message": {
- "type": "string"
- }
- }
- }
- }
- }
- }
+ "type": "string",
+ "format": "binary"
}
}
}
},
"500": {
- "description": "",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "required": [
- "ocs"
- ],
- "properties": {
- "ocs": {
- "type": "object",
- "required": [
- "meta",
- "data"
- ],
- "properties": {
- "meta": {
- "$ref": "#/components/schemas/OCSMeta"
- },
- "data": {
- "type": "object",
- "required": [
- "message"
- ],
- "properties": {
- "message": {
- "type": "string"
- }
- }
- }
- }
- }
- }
- }
- }
- }
+ "description": ""
}
}
- },
- "delete": {
- "operationId": "text_processing_api-delete-task",
- "summary": "This endpoint allows to delete a scheduled task for a user",
+ }
+ },
+ "/index.php/avatar/guest/{guestName}/{size}/dark": {
+ "get": {
+ "operationId": "guest_avatar-get-avatar-dark",
+ "summary": "Returns a dark guest avatar image response",
"tags": [
- "text_processing_api"
+ "guest_avatar"
],
"security": [
+ {},
{
"bearer_auth": []
},
@@ -5211,150 +5652,59 @@
],
"parameters": [
{
- "name": "id",
+ "name": "guestName",
"in": "path",
- "description": "The id of the task",
+ "description": "The guest name, e.g. \"Albert\"",
"required": true,
"schema": {
- "type": "integer",
- "format": "int64"
+ "type": "string"
}
},
{
- "name": "OCS-APIRequest",
- "in": "header",
- "description": "Required to be true for the API request to pass",
+ "name": "size",
+ "in": "path",
+ "description": "The desired avatar size, e.g. 64 for 64x64px",
"required": true,
"schema": {
- "type": "boolean",
- "default": true
+ "type": "string"
}
}
],
"responses": {
"200": {
- "description": "Task returned",
+ "description": "Custom avatar returned",
"content": {
- "application/json": {
+ "*/*": {
"schema": {
- "type": "object",
- "required": [
- "ocs"
- ],
- "properties": {
- "ocs": {
- "type": "object",
- "required": [
- "meta",
- "data"
- ],
- "properties": {
- "meta": {
- "$ref": "#/components/schemas/OCSMeta"
- },
- "data": {
- "type": "object",
- "required": [
- "task"
- ],
- "properties": {
- "task": {
- "$ref": "#/components/schemas/TextProcessingTask"
- }
- }
- }
- }
- }
- }
+ "type": "string",
+ "format": "binary"
}
}
}
},
- "404": {
- "description": "Task not found",
+ "201": {
+ "description": "Avatar returned",
"content": {
- "application/json": {
+ "*/*": {
"schema": {
- "type": "object",
- "required": [
- "ocs"
- ],
- "properties": {
- "ocs": {
- "type": "object",
- "required": [
- "meta",
- "data"
- ],
- "properties": {
- "meta": {
- "$ref": "#/components/schemas/OCSMeta"
- },
- "data": {
- "type": "object",
- "required": [
- "message"
- ],
- "properties": {
- "message": {
- "type": "string"
- }
- }
- }
- }
- }
- }
+ "type": "string",
+ "format": "binary"
}
}
}
},
"500": {
- "description": "",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "required": [
- "ocs"
- ],
- "properties": {
- "ocs": {
- "type": "object",
- "required": [
- "meta",
- "data"
- ],
- "properties": {
- "meta": {
- "$ref": "#/components/schemas/OCSMeta"
- },
- "data": {
- "type": "object",
- "required": [
- "message"
- ],
- "properties": {
- "message": {
- "type": "string"
- }
- }
- }
- }
- }
- }
- }
- }
- }
+ "description": ""
}
}
}
},
- "/ocs/v2.php/textprocessing/tasks/app/{appId}": {
- "get": {
- "operationId": "text_processing_api-list-tasks-by-app",
- "summary": "This endpoint returns a list of tasks of a user that are related with a specific appId and optionally with an identifier",
+ "/index.php/login/confirm": {
+ "post": {
+ "operationId": "login-confirm-password",
+ "summary": "Confirm the user password",
"tags": [
- "text_processing_api"
+ "login"
],
"security": [
{
@@ -5366,123 +5716,52 @@
],
"parameters": [
{
- "name": "identifier",
+ "name": "password",
"in": "query",
- "description": "An arbitrary identifier for the task",
+ "description": "The password of the user",
+ "required": true,
"schema": {
- "type": "string",
- "nullable": true
- }
- },
- {
- "name": "appId",
- "in": "path",
- "description": "ID of the app",
- "required": true,
- "schema": {
- "type": "string"
- }
- },
- {
- "name": "OCS-APIRequest",
- "in": "header",
- "description": "Required to be true for the API request to pass",
- "required": true,
- "schema": {
- "type": "boolean",
- "default": true
+ "type": "string"
}
}
],
"responses": {
"200": {
- "description": "Task list returned",
+ "description": "Password confirmation succeeded",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
- "ocs"
+ "lastLogin"
],
"properties": {
- "ocs": {
- "type": "object",
- "required": [
- "meta",
- "data"
- ],
- "properties": {
- "meta": {
- "$ref": "#/components/schemas/OCSMeta"
- },
- "data": {
- "type": "object",
- "required": [
- "tasks"
- ],
- "properties": {
- "tasks": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/TextProcessingTask"
- }
- }
- }
- }
- }
+ "lastLogin": {
+ "type": "integer",
+ "format": "int64"
}
}
}
}
}
},
- "500": {
- "description": "",
+ "403": {
+ "description": "Password confirmation failed",
"content": {
"application/json": {
- "schema": {
- "type": "object",
- "required": [
- "ocs"
- ],
- "properties": {
- "ocs": {
- "type": "object",
- "required": [
- "meta",
- "data"
- ],
- "properties": {
- "meta": {
- "$ref": "#/components/schemas/OCSMeta"
- },
- "data": {
- "type": "object",
- "required": [
- "message"
- ],
- "properties": {
- "message": {
- "type": "string"
- }
- }
- }
- }
- }
- }
- }
+ "schema": {}
}
}
}
}
}
},
- "/ocs/v2.php/text2image/is_available": {
+ "/index.php/ocm-provider": {
"get": {
- "operationId": "text_to_image_api-is-available",
- "summary": "Check whether this feature is available",
+ "operationId": "ocm-discovery",
+ "summary": "generate a OCMProvider with local data and send it as DataResponse. This replaces the old PHP file ocm-provider/index.php",
"tags": [
- "text_to_image_api"
+ "ocm"
],
"security": [
{},
@@ -5493,47 +5772,67 @@
"basic_auth": []
}
],
- "parameters": [
- {
- "name": "OCS-APIRequest",
- "in": "header",
- "description": "Required to be true for the API request to pass",
- "required": true,
- "schema": {
- "type": "boolean",
- "default": true
- }
- }
- ],
"responses": {
"200": {
- "description": "Returns availability status",
+ "description": "OCM Provider details returned",
+ "headers": {
+ "X-NEXTCLOUD-OCM-PROVIDERS": {
+ "schema": {
+ "type": "boolean",
+ "enum": [
+ true
+ ]
+ }
+ }
+ },
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
- "ocs"
+ "enabled",
+ "apiVersion",
+ "endPoint",
+ "resourceTypes"
],
"properties": {
- "ocs": {
- "type": "object",
- "required": [
- "meta",
- "data"
- ],
- "properties": {
- "meta": {
- "$ref": "#/components/schemas/OCSMeta"
- },
- "data": {
- "type": "object",
- "required": [
- "isAvailable"
- ],
- "properties": {
- "isAvailable": {
- "type": "boolean"
+ "enabled": {
+ "type": "boolean"
+ },
+ "apiVersion": {
+ "type": "string"
+ },
+ "endPoint": {
+ "type": "string"
+ },
+ "resourceTypes": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "required": [
+ "name",
+ "shareTypes",
+ "protocols"
+ ],
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "shareTypes": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "protocols": {
+ "type": "object",
+ "required": [
+ "webdav"
+ ],
+ "properties": {
+ "webdav": {
+ "type": "string"
+ }
}
}
}
@@ -5543,19 +5842,36 @@
}
}
}
+ },
+ "500": {
+ "description": "OCM not supported",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "message"
+ ],
+ "properties": {
+ "message": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
}
}
}
},
- "/ocs/v2.php/text2image/schedule": {
- "post": {
- "operationId": "text_to_image_api-schedule",
- "summary": "This endpoint allows scheduling a text to image task",
+ "/index.php/core/preview.png": {
+ "get": {
+ "operationId": "preview-get-preview",
+ "summary": "Get a preview by file path",
"tags": [
- "text_to_image_api"
+ "preview"
],
"security": [
- {},
{
"bearer_auth": []
},
@@ -5565,164 +5881,125 @@
],
"parameters": [
{
- "name": "input",
+ "name": "file",
"in": "query",
- "description": "Input text",
- "required": true,
+ "description": "Path of the file",
"schema": {
- "type": "string"
+ "type": "string",
+ "default": ""
}
},
{
- "name": "appId",
+ "name": "x",
"in": "query",
- "description": "ID of the app that will execute the task",
- "required": true,
+ "description": "Width of the preview",
"schema": {
- "type": "string"
+ "type": "integer",
+ "format": "int64",
+ "default": 32
}
},
{
- "name": "identifier",
+ "name": "y",
"in": "query",
- "description": "An arbitrary identifier for the task",
+ "description": "Height of the preview",
"schema": {
- "type": "string",
- "default": ""
+ "type": "integer",
+ "format": "int64",
+ "default": 32
}
},
{
- "name": "numberOfImages",
+ "name": "a",
"in": "query",
- "description": "The number of images to generate",
+ "description": "Whether to not crop the preview",
"schema": {
"type": "integer",
- "format": "int64",
- "default": 8
+ "default": 0,
+ "enum": [
+ 0,
+ 1
+ ]
}
},
{
- "name": "OCS-APIRequest",
- "in": "header",
- "description": "Required to be true for the API request to pass",
- "required": true,
+ "name": "forceIcon",
+ "in": "query",
+ "description": "Force returning an icon",
"schema": {
- "type": "boolean",
- "default": true
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Task scheduled successfully",
+ "type": "integer",
+ "default": 1,
+ "enum": [
+ 0,
+ 1
+ ]
+ }
+ },
+ {
+ "name": "mode",
+ "in": "query",
+ "description": "How to crop the image",
+ "schema": {
+ "type": "string",
+ "default": "fill"
+ }
+ },
+ {
+ "name": "mimeFallback",
+ "in": "query",
+ "description": "Whether to fallback to the mime icon if no preview is available",
+ "schema": {
+ "type": "integer",
+ "default": 0,
+ "enum": [
+ 0,
+ 1
+ ]
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Preview returned",
"content": {
- "application/json": {
+ "*/*": {
"schema": {
- "type": "object",
- "required": [
- "ocs"
- ],
- "properties": {
- "ocs": {
- "type": "object",
- "required": [
- "meta",
- "data"
- ],
- "properties": {
- "meta": {
- "$ref": "#/components/schemas/OCSMeta"
- },
- "data": {
- "type": "object",
- "required": [
- "task"
- ],
- "properties": {
- "task": {
- "$ref": "#/components/schemas/TextToImageTask"
- }
- }
- }
- }
- }
- }
+ "type": "string",
+ "format": "binary"
}
}
}
},
- "412": {
- "description": "Scheduling task is not possible",
+ "400": {
+ "description": "Getting preview is not possible",
"content": {
"application/json": {
- "schema": {
- "type": "object",
- "required": [
- "ocs"
- ],
- "properties": {
- "ocs": {
- "type": "object",
- "required": [
- "meta",
- "data"
- ],
- "properties": {
- "meta": {
- "$ref": "#/components/schemas/OCSMeta"
- },
- "data": {
- "type": "object",
- "required": [
- "message"
- ],
- "properties": {
- "message": {
- "type": "string"
- }
- }
- }
- }
- }
- }
- }
+ "schema": {}
}
}
},
- "500": {
- "description": "",
+ "403": {
+ "description": "Getting preview is not allowed",
"content": {
"application/json": {
+ "schema": {}
+ }
+ }
+ },
+ "404": {
+ "description": "Preview not found",
+ "content": {
+ "application/json": {
+ "schema": {}
+ }
+ }
+ },
+ "303": {
+ "description": "Redirect to the mime icon url if mimeFallback is true",
+ "headers": {
+ "Location": {
"schema": {
- "type": "object",
- "required": [
- "ocs"
- ],
- "properties": {
- "ocs": {
- "type": "object",
- "required": [
- "meta",
- "data"
- ],
- "properties": {
- "meta": {
- "$ref": "#/components/schemas/OCSMeta"
- },
- "data": {
- "type": "object",
- "required": [
- "message"
- ],
- "properties": {
- "message": {
- "type": "string"
- }
- }
- }
- }
- }
- }
+ "type": "string"
}
}
}
@@ -5730,15 +6007,14 @@
}
}
},
- "/ocs/v2.php/text2image/task/{id}": {
+ "/index.php/core/preview": {
"get": {
- "operationId": "text_to_image_api-get-task",
- "summary": "This endpoint allows checking the status and results of a task. Tasks are removed 1 week after receiving their last update.",
+ "operationId": "preview-get-preview-by-file-id",
+ "summary": "Get a preview by file ID",
"tags": [
- "text_to_image_api"
+ "preview"
],
"security": [
- {},
{
"bearer_auth": []
},
@@ -5748,290 +6024,126 @@
],
"parameters": [
{
- "name": "id",
- "in": "path",
- "description": "The id of the task",
- "required": true,
+ "name": "fileId",
+ "in": "query",
+ "description": "ID of the file",
"schema": {
"type": "integer",
- "format": "int64"
+ "format": "int64",
+ "default": -1
}
},
{
- "name": "OCS-APIRequest",
- "in": "header",
- "description": "Required to be true for the API request to pass",
- "required": true,
+ "name": "x",
+ "in": "query",
+ "description": "Width of the preview",
"schema": {
- "type": "boolean",
- "default": true
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Task returned",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "required": [
- "ocs"
- ],
- "properties": {
- "ocs": {
- "type": "object",
- "required": [
- "meta",
- "data"
- ],
- "properties": {
- "meta": {
- "$ref": "#/components/schemas/OCSMeta"
- },
- "data": {
- "type": "object",
- "required": [
- "task"
- ],
- "properties": {
- "task": {
- "$ref": "#/components/schemas/TextToImageTask"
- }
- }
- }
- }
- }
- }
- }
- }
+ "type": "integer",
+ "format": "int64",
+ "default": 32
}
},
- "404": {
- "description": "Task not found",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "required": [
- "ocs"
- ],
- "properties": {
- "ocs": {
- "type": "object",
- "required": [
- "meta",
- "data"
- ],
- "properties": {
- "meta": {
- "$ref": "#/components/schemas/OCSMeta"
- },
- "data": {
- "type": "object",
- "required": [
- "message"
- ],
- "properties": {
- "message": {
- "type": "string"
- }
- }
- }
- }
- }
- }
- }
- }
+ {
+ "name": "y",
+ "in": "query",
+ "description": "Height of the preview",
+ "schema": {
+ "type": "integer",
+ "format": "int64",
+ "default": 32
}
},
- "500": {
- "description": "",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "required": [
- "ocs"
- ],
- "properties": {
- "ocs": {
- "type": "object",
- "required": [
- "meta",
- "data"
- ],
- "properties": {
- "meta": {
- "$ref": "#/components/schemas/OCSMeta"
- },
- "data": {
- "type": "object",
- "required": [
- "message"
- ],
- "properties": {
- "message": {
- "type": "string"
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- },
- "delete": {
- "operationId": "text_to_image_api-delete-task",
- "summary": "This endpoint allows to delete a scheduled task for a user",
- "tags": [
- "text_to_image_api"
- ],
- "security": [
{
- "bearer_auth": []
+ "name": "a",
+ "in": "query",
+ "description": "Whether to not crop the preview",
+ "schema": {
+ "type": "integer",
+ "default": 0,
+ "enum": [
+ 0,
+ 1
+ ]
+ }
},
{
- "basic_auth": []
- }
- ],
- "parameters": [
- {
- "name": "id",
- "in": "path",
- "description": "The id of the task",
- "required": true,
+ "name": "forceIcon",
+ "in": "query",
+ "description": "Force returning an icon",
"schema": {
"type": "integer",
- "format": "int64"
+ "default": 1,
+ "enum": [
+ 0,
+ 1
+ ]
}
},
{
- "name": "OCS-APIRequest",
- "in": "header",
- "description": "Required to be true for the API request to pass",
- "required": true,
+ "name": "mode",
+ "in": "query",
+ "description": "How to crop the image",
"schema": {
- "type": "boolean",
- "default": true
+ "type": "string",
+ "default": "fill"
+ }
+ },
+ {
+ "name": "mimeFallback",
+ "in": "query",
+ "description": "Whether to fallback to the mime icon if no preview is available",
+ "schema": {
+ "type": "integer",
+ "default": 0,
+ "enum": [
+ 0,
+ 1
+ ]
}
}
],
"responses": {
"200": {
- "description": "Task returned",
+ "description": "Preview returned",
"content": {
- "application/json": {
+ "*/*": {
"schema": {
- "type": "object",
- "required": [
- "ocs"
- ],
- "properties": {
- "ocs": {
- "type": "object",
- "required": [
- "meta",
- "data"
- ],
- "properties": {
- "meta": {
- "$ref": "#/components/schemas/OCSMeta"
- },
- "data": {
- "type": "object",
- "required": [
- "task"
- ],
- "properties": {
- "task": {
- "$ref": "#/components/schemas/TextToImageTask"
- }
- }
- }
- }
- }
- }
+ "type": "string",
+ "format": "binary"
}
}
}
},
- "404": {
- "description": "Task not found",
+ "400": {
+ "description": "Getting preview is not possible",
"content": {
"application/json": {
- "schema": {
- "type": "object",
- "required": [
- "ocs"
- ],
- "properties": {
- "ocs": {
- "type": "object",
- "required": [
- "meta",
- "data"
- ],
- "properties": {
- "meta": {
- "$ref": "#/components/schemas/OCSMeta"
- },
- "data": {
- "type": "object",
- "required": [
- "message"
- ],
- "properties": {
- "message": {
- "type": "string"
- }
- }
- }
- }
- }
- }
- }
+ "schema": {}
}
}
},
- "500": {
- "description": "",
+ "403": {
+ "description": "Getting preview is not allowed",
"content": {
"application/json": {
- "schema": {
- "type": "object",
- "required": [
- "ocs"
- ],
- "properties": {
- "ocs": {
- "type": "object",
- "required": [
- "meta",
- "data"
- ],
- "properties": {
- "meta": {
- "$ref": "#/components/schemas/OCSMeta"
- },
- "data": {
- "type": "object",
- "required": [
- "message"
- ],
- "properties": {
- "message": {
- "type": "string"
- }
- }
- }
- }
- }
- }
+ "schema": {}
+ }
+ }
+ },
+ "404": {
+ "description": "Preview not found",
+ "content": {
+ "application/json": {
+ "schema": {}
+ }
+ }
+ },
+ "303": {
+ "description": "Redirect to the mime icon url if mimeFallback is true",
+ "headers": {
+ "Location": {
+ "schema": {
+ "type": "string"
}
}
}
@@ -6039,12 +6151,12 @@
}
}
},
- "/ocs/v2.php/text2image/task/{id}/image/{index}": {
+ "/index.php/core/references/preview/{referenceId}": {
"get": {
- "operationId": "text_to_image_api-get-image",
- "summary": "This endpoint allows downloading the resulting image of a task",
+ "operationId": "reference-preview",
+ "summary": "Get a preview for a reference",
"tags": [
- "text_to_image_api"
+ "reference"
],
"security": [
{},
@@ -6057,39 +6169,18 @@
],
"parameters": [
{
- "name": "id",
- "in": "path",
- "description": "The id of the task",
- "required": true,
- "schema": {
- "type": "integer",
- "format": "int64"
- }
- },
- {
- "name": "index",
+ "name": "referenceId",
"in": "path",
- "description": "The index of the image to retrieve",
- "required": true,
- "schema": {
- "type": "integer",
- "format": "int64"
- }
- },
- {
- "name": "OCS-APIRequest",
- "in": "header",
- "description": "Required to be true for the API request to pass",
+ "description": "the reference cache key",
"required": true,
"schema": {
- "type": "boolean",
- "default": true
+ "type": "string"
}
}
],
"responses": {
"200": {
- "description": "Image returned",
+ "description": "Preview returned",
"content": {
"*/*": {
"schema": {
@@ -6100,92 +6191,84 @@
}
},
"404": {
- "description": "Task or image not found",
+ "description": "Reference not found",
"content": {
"application/json": {
"schema": {
- "type": "object",
- "required": [
- "ocs"
- ],
- "properties": {
- "ocs": {
- "type": "object",
- "required": [
- "meta",
- "data"
- ],
- "properties": {
- "meta": {
- "$ref": "#/components/schemas/OCSMeta"
- },
- "data": {
- "type": "object",
- "required": [
- "message"
- ],
- "properties": {
- "message": {
- "type": "string"
- }
- }
- }
- }
- }
- }
+ "type": "string"
}
}
}
+ }
+ }
+ }
+ },
+ "/index.php/core/wipe/check": {
+ "post": {
+ "operationId": "wipe-check-wipe",
+ "summary": "Check if the device should be wiped",
+ "tags": [
+ "wipe"
+ ],
+ "security": [
+ {},
+ {
+ "bearer_auth": []
},
- "500": {
- "description": "",
+ {
+ "basic_auth": []
+ }
+ ],
+ "parameters": [
+ {
+ "name": "token",
+ "in": "query",
+ "description": "App password",
+ "required": true,
+ "schema": {
+ "type": "string"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Device should be wiped",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
- "ocs"
+ "wipe"
],
"properties": {
- "ocs": {
- "type": "object",
- "required": [
- "meta",
- "data"
- ],
- "properties": {
- "meta": {
- "$ref": "#/components/schemas/OCSMeta"
- },
- "data": {
- "type": "object",
- "required": [
- "message"
- ],
- "properties": {
- "message": {
- "type": "string"
- }
- }
- }
- }
+ "wipe": {
+ "type": "boolean"
}
}
}
}
}
+ },
+ "404": {
+ "description": "Device should not be wiped",
+ "content": {
+ "application/json": {
+ "schema": {}
+ }
+ }
}
}
}
},
- "/ocs/v2.php/text2image/tasks/app/{appId}": {
- "get": {
- "operationId": "text_to_image_api-list-tasks-by-app",
- "summary": "This endpoint returns a list of tasks of a user that are related with a specific appId and optionally with an identifier",
+ "/index.php/core/wipe/success": {
+ "post": {
+ "operationId": "wipe-wipe-done",
+ "summary": "Finish the wipe",
"tags": [
- "text_to_image_api"
+ "wipe"
],
"security": [
+ {},
{
"bearer_auth": []
},
@@ -6195,111 +6278,29 @@
],
"parameters": [
{
- "name": "identifier",
+ "name": "token",
"in": "query",
- "description": "An arbitrary identifier for the task",
- "schema": {
- "type": "string",
- "nullable": true
- }
- },
- {
- "name": "appId",
- "in": "path",
- "description": "ID of the app",
+ "description": "App password",
"required": true,
"schema": {
"type": "string"
}
- },
- {
- "name": "OCS-APIRequest",
- "in": "header",
- "description": "Required to be true for the API request to pass",
- "required": true,
- "schema": {
- "type": "boolean",
- "default": true
- }
}
],
"responses": {
"200": {
- "description": "Task list returned",
+ "description": "Wipe finished successfully",
"content": {
"application/json": {
- "schema": {
- "type": "object",
- "required": [
- "ocs"
- ],
- "properties": {
- "ocs": {
- "type": "object",
- "required": [
- "meta",
- "data"
- ],
- "properties": {
- "meta": {
- "$ref": "#/components/schemas/OCSMeta"
- },
- "data": {
- "type": "object",
- "required": [
- "tasks"
- ],
- "properties": {
- "tasks": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/TextToImageTask"
- }
- }
- }
- }
- }
- }
- }
- }
+ "schema": {}
}
}
},
- "500": {
- "description": "",
+ "404": {
+ "description": "Device should not be wiped",
"content": {
"application/json": {
- "schema": {
- "type": "object",
- "required": [
- "ocs"
- ],
- "properties": {
- "ocs": {
- "type": "object",
- "required": [
- "meta",
- "data"
- ],
- "properties": {
- "meta": {
- "$ref": "#/components/schemas/OCSMeta"
- },
- "data": {
- "type": "object",
- "required": [
- "message"
- ],
- "properties": {
- "message": {
- "type": "string"
- }
- }
- }
- }
- }
- }
- }
+ "schema": {}
}
}
}
diff --git a/core/routes.php b/core/routes.php
index 9f8bc5c2c1e1e..4397f8473dbb9 100644
--- a/core/routes.php
+++ b/core/routes.php
@@ -35,139 +35,6 @@
*
*/
-use OC\Core\Application;
-
-/** @var Application $application */
-$application = \OC::$server->query(Application::class);
-$application->registerRoutes($this, [
- 'routes' => [
- ['name' => 'lost#email', 'url' => '/lostpassword/email', 'verb' => 'POST'],
- ['name' => 'lost#resetform', 'url' => '/lostpassword/reset/form/{token}/{userId}', 'verb' => 'GET'],
- ['name' => 'lost#setPassword', 'url' => '/lostpassword/set/{token}/{userId}', 'verb' => 'POST'],
- ['name' => 'ProfilePage#index', 'url' => '/u/{targetUserId}', 'verb' => 'GET'],
- ['name' => 'user#getDisplayNames', 'url' => '/displaynames', 'verb' => 'POST'],
- ['name' => 'avatar#getAvatarDark', 'url' => '/avatar/{userId}/{size}/dark', 'verb' => 'GET'],
- ['name' => 'avatar#getAvatar', 'url' => '/avatar/{userId}/{size}', 'verb' => 'GET'],
- ['name' => 'avatar#deleteAvatar', 'url' => '/avatar/', 'verb' => 'DELETE'],
- ['name' => 'avatar#postCroppedAvatar', 'url' => '/avatar/cropped', 'verb' => 'POST'],
- ['name' => 'avatar#getTmpAvatar', 'url' => '/avatar/tmp', 'verb' => 'GET'],
- ['name' => 'avatar#postAvatar', 'url' => '/avatar/', 'verb' => 'POST'],
- ['name' => 'GuestAvatar#getAvatarDark', 'url' => '/avatar/guest/{guestName}/{size}/dark', 'verb' => 'GET'],
- ['name' => 'GuestAvatar#getAvatar', 'url' => '/avatar/guest/{guestName}/{size}', 'verb' => 'GET'],
- ['name' => 'CSRFToken#index', 'url' => '/csrftoken', 'verb' => 'GET'],
- ['name' => 'login#tryLogin', 'url' => '/login', 'verb' => 'POST'],
- ['name' => 'login#confirmPassword', 'url' => '/login/confirm', 'verb' => 'POST'],
- ['name' => 'login#showLoginForm', 'url' => '/login', 'verb' => 'GET'],
- ['name' => 'login#logout', 'url' => '/logout', 'verb' => 'GET'],
-
- // Original login flow used by all clients
- ['name' => 'ClientFlowLogin#showAuthPickerPage', 'url' => '/login/flow', 'verb' => 'GET'],
- ['name' => 'ClientFlowLogin#generateAppPassword', 'url' => '/login/flow', 'verb' => 'POST'],
- ['name' => 'ClientFlowLogin#grantPage', 'url' => '/login/flow/grant', 'verb' => 'GET'],
- ['name' => 'ClientFlowLogin#apptokenRedirect', 'url' => '/login/flow/apptoken', 'verb' => 'POST'],
-
- // NG login flow used by desktop client in case of Kerberos/fancy 2fa (smart cards for example)
- ['name' => 'ClientFlowLoginV2#poll', 'url' => '/login/v2/poll', 'verb' => 'POST'],
- ['name' => 'ClientFlowLoginV2#showAuthPickerPage', 'url' => '/login/v2/flow', 'verb' => 'GET'],
- ['name' => 'ClientFlowLoginV2#landing', 'url' => '/login/v2/flow/{token}', 'verb' => 'GET'],
- ['name' => 'ClientFlowLoginV2#grantPage', 'url' => '/login/v2/grant', 'verb' => 'GET'],
- ['name' => 'ClientFlowLoginV2#generateAppPassword', 'url' => '/login/v2/grant', 'verb' => 'POST'],
- ['name' => 'ClientFlowLoginV2#init', 'url' => '/login/v2', 'verb' => 'POST'],
- ['name' => 'ClientFlowLoginV2#apptokenRedirect', 'url' => '/login/v2/apptoken', 'verb' => 'POST'],
- ['name' => 'TwoFactorChallenge#selectChallenge', 'url' => '/login/selectchallenge', 'verb' => 'GET'],
- ['name' => 'TwoFactorChallenge#showChallenge', 'url' => '/login/challenge/{challengeProviderId}', 'verb' => 'GET'],
- ['name' => 'TwoFactorChallenge#solveChallenge', 'url' => '/login/challenge/{challengeProviderId}', 'verb' => 'POST'],
- ['name' => 'TwoFactorChallenge#setupProviders', 'url' => 'login/setupchallenge', 'verb' => 'GET'],
- ['name' => 'TwoFactorChallenge#setupProvider', 'url' => 'login/setupchallenge/{providerId}', 'verb' => 'GET'],
- ['name' => 'TwoFactorChallenge#confirmProviderSetup', 'url' => 'login/setupchallenge/{providerId}', 'verb' => 'POST'],
- ['name' => 'OCJS#getConfig', 'url' => '/core/js/oc.js', 'verb' => 'GET'],
- ['name' => 'Preview#getPreviewByFileId', 'url' => '/core/preview', 'verb' => 'GET'],
- ['name' => 'Preview#getPreview', 'url' => '/core/preview.png', 'verb' => 'GET'],
- ['name' => 'RecommendedApps#index', 'url' => '/core/apps/recommended', 'verb' => 'GET'],
- ['name' => 'Reference#preview', 'url' => '/core/references/preview/{referenceId}', 'verb' => 'GET'],
- ['name' => 'Css#getCss', 'url' => '/css/{appName}/{fileName}', 'verb' => 'GET'],
- ['name' => 'Js#getJs', 'url' => '/js/{appName}/{fileName}', 'verb' => 'GET'],
- ['name' => 'contactsMenu#index', 'url' => '/contactsmenu/contacts', 'verb' => 'POST'],
- ['name' => 'contactsMenu#findOne', 'url' => '/contactsmenu/findOne', 'verb' => 'POST'],
- ['name' => 'WalledGarden#get', 'url' => '/204', 'verb' => 'GET'],
- ['name' => 'Search#search', 'url' => '/core/search', 'verb' => 'GET'],
- ['name' => 'Wipe#checkWipe', 'url' => '/core/wipe/check', 'verb' => 'POST'],
- ['name' => 'Wipe#wipeDone', 'url' => '/core/wipe/success', 'verb' => 'POST'],
-
- // Logins for passwordless auth
- ['name' => 'WebAuthn#startAuthentication', 'url' => 'login/webauthn/start', 'verb' => 'POST'],
- ['name' => 'WebAuthn#finishAuthentication', 'url' => 'login/webauthn/finish', 'verb' => 'POST'],
-
- ['name' => 'Error#error404', 'url' => 'error/404'],
- ['name' => 'Error#error403', 'url' => 'error/403'],
-
- // Well known requests https://tools.ietf.org/html/rfc5785
- ['name' => 'WellKnown#handle', 'url' => '.well-known/{service}'],
-
- // OCM Provider requests https://github.com/cs3org/OCM-API
- ['name' => 'OCM#discovery', 'url' => '/ocm-provider/'],
-
- // Unsupported browser
- ['name' => 'UnsupportedBrowser#index', 'url' => 'unsupported'],
- ],
- 'ocs' => [
- ['root' => '/cloud', 'name' => 'OCS#getCapabilities', 'url' => '/capabilities', 'verb' => 'GET'],
- ['root' => '', 'name' => 'OCS#getConfig', 'url' => '/config', 'verb' => 'GET'],
- ['root' => '/person', 'name' => 'OCS#personCheck', 'url' => '/check', 'verb' => 'POST'],
- ['root' => '/identityproof', 'name' => 'OCS#getIdentityProof', 'url' => '/key/{cloudId}', 'verb' => 'GET'],
- ['root' => '/core', 'name' => 'Navigation#getAppsNavigation', 'url' => '/navigation/apps', 'verb' => 'GET'],
- ['root' => '/core', 'name' => 'Navigation#getSettingsNavigation', 'url' => '/navigation/settings', 'verb' => 'GET'],
- ['root' => '/core', 'name' => 'AutoComplete#get', 'url' => '/autocomplete/get', 'verb' => 'GET'],
- ['root' => '/core', 'name' => 'WhatsNew#get', 'url' => '/whatsnew', 'verb' => 'GET'],
- ['root' => '/core', 'name' => 'WhatsNew#dismiss', 'url' => '/whatsnew', 'verb' => 'POST'],
- ['root' => '/core', 'name' => 'AppPassword#getAppPassword', 'url' => '/getapppassword', 'verb' => 'GET'],
- ['root' => '/core', 'name' => 'AppPassword#rotateAppPassword', 'url' => '/apppassword/rotate', 'verb' => 'POST'],
- ['root' => '/core', 'name' => 'AppPassword#deleteAppPassword', 'url' => '/apppassword', 'verb' => 'DELETE'],
- ['root' => '/core', 'name' => 'AppPassword#confirmUserPassword', 'url' => '/apppassword/confirm', 'verb' => 'PUT'],
-
- ['root' => '/hovercard', 'name' => 'HoverCard#getUser', 'url' => '/v1/{userId}', 'verb' => 'GET'],
-
- ['root' => '/collaboration', 'name' => 'CollaborationResources#searchCollections', 'url' => '/resources/collections/search/{filter}', 'verb' => 'GET'],
- ['root' => '/collaboration', 'name' => 'CollaborationResources#listCollection', 'url' => '/resources/collections/{collectionId}', 'verb' => 'GET'],
- ['root' => '/collaboration', 'name' => 'CollaborationResources#renameCollection', 'url' => '/resources/collections/{collectionId}', 'verb' => 'PUT'],
- ['root' => '/collaboration', 'name' => 'CollaborationResources#addResource', 'url' => '/resources/collections/{collectionId}', 'verb' => 'POST'],
-
- ['root' => '/collaboration', 'name' => 'CollaborationResources#removeResource', 'url' => '/resources/collections/{collectionId}', 'verb' => 'DELETE'],
- ['root' => '/collaboration', 'name' => 'CollaborationResources#getCollectionsByResource', 'url' => '/resources/{resourceType}/{resourceId}', 'verb' => 'GET'],
- ['root' => '/collaboration', 'name' => 'CollaborationResources#createCollectionOnResource', 'url' => '/resources/{baseResourceType}/{baseResourceId}', 'verb' => 'POST'],
-
- ['root' => '/references', 'name' => 'ReferenceApi#resolveOne', 'url' => '/resolve', 'verb' => 'GET'],
- ['root' => '/references', 'name' => 'ReferenceApi#extract', 'url' => '/extract', 'verb' => 'POST'],
- ['root' => '/references', 'name' => 'ReferenceApi#resolve', 'url' => '/resolve', 'verb' => 'POST'],
- ['root' => '/references', 'name' => 'ReferenceApi#getProvidersInfo', 'url' => '/providers', 'verb' => 'GET'],
- ['root' => '/references', 'name' => 'ReferenceApi#touchProvider', 'url' => '/provider/{providerId}', 'verb' => 'PUT'],
-
- ['root' => '/profile', 'name' => 'ProfileApi#setVisibility', 'url' => '/{targetUserId}', 'verb' => 'PUT'],
-
- // Unified search
- ['root' => '/search', 'name' => 'UnifiedSearch#getProviders', 'url' => '/providers', 'verb' => 'GET'],
- ['root' => '/search', 'name' => 'UnifiedSearch#search', 'url' => '/providers/{providerId}/search', 'verb' => 'GET'],
-
- ['root' => '/translation', 'name' => 'TranslationApi#languages', 'url' => '/languages', 'verb' => 'GET'],
- ['root' => '/translation', 'name' => 'TranslationApi#translate', 'url' => '/translate', 'verb' => 'POST'],
-
- ['root' => '/textprocessing', 'name' => 'TextProcessingApi#taskTypes', 'url' => '/tasktypes', 'verb' => 'GET'],
- ['root' => '/textprocessing', 'name' => 'TextProcessingApi#schedule', 'url' => '/schedule', 'verb' => 'POST'],
- ['root' => '/textprocessing', 'name' => 'TextProcessingApi#getTask', 'url' => '/task/{id}', 'verb' => 'GET'],
- ['root' => '/textprocessing', 'name' => 'TextProcessingApi#deleteTask', 'url' => '/task/{id}', 'verb' => 'DELETE'],
- ['root' => '/textprocessing', 'name' => 'TextProcessingApi#listTasksByApp', 'url' => '/tasks/app/{appId}', 'verb' => 'GET'],
-
- ['root' => '/text2image', 'name' => 'TextToImageApi#isAvailable', 'url' => '/is_available', 'verb' => 'GET'],
- ['root' => '/text2image', 'name' => 'TextToImageApi#schedule', 'url' => '/schedule', 'verb' => 'POST'],
- ['root' => '/text2image', 'name' => 'TextToImageApi#getTask', 'url' => '/task/{id}', 'verb' => 'GET'],
- ['root' => '/text2image', 'name' => 'TextToImageApi#getImage', 'url' => '/task/{id}/image/{index}', 'verb' => 'GET'],
- ['root' => '/text2image', 'name' => 'TextToImageApi#deleteTask', 'url' => '/task/{id}', 'verb' => 'DELETE'],
- ['root' => '/text2image', 'name' => 'TextToImageApi#listTasksByApp', 'url' => '/tasks/app/{appId}', 'verb' => 'GET'],
- ],
-]);
-
-// Post installation check
-
/** @var $this OCP\Route\IRouter */
// Core ajax actions
// Routing
diff --git a/lib/composer/composer/autoload_classmap.php b/lib/composer/composer/autoload_classmap.php
index 9c3bf0f7e9a13..84dcb562a8dd0 100644
--- a/lib/composer/composer/autoload_classmap.php
+++ b/lib/composer/composer/autoload_classmap.php
@@ -38,15 +38,18 @@
'OCP\\AppFramework\\Http' => $baseDir . '/lib/public/AppFramework/Http.php',
'OCP\\AppFramework\\Http\\Attribute\\ARateLimit' => $baseDir . '/lib/public/AppFramework/Http/Attribute/ARateLimit.php',
'OCP\\AppFramework\\Http\\Attribute\\AnonRateLimit' => $baseDir . '/lib/public/AppFramework/Http/Attribute/AnonRateLimit.php',
+ 'OCP\\AppFramework\\Http\\Attribute\\ApiRoute' => $baseDir . '/lib/public/AppFramework/Http/Attribute/ApiRoute.php',
'OCP\\AppFramework\\Http\\Attribute\\AuthorizedAdminSetting' => $baseDir . '/lib/public/AppFramework/Http/Attribute/AuthorizedAdminSetting.php',
'OCP\\AppFramework\\Http\\Attribute\\BruteForceProtection' => $baseDir . '/lib/public/AppFramework/Http/Attribute/BruteForceProtection.php',
'OCP\\AppFramework\\Http\\Attribute\\CORS' => $baseDir . '/lib/public/AppFramework/Http/Attribute/CORS.php',
+ 'OCP\\AppFramework\\Http\\Attribute\\FrontpageRoute' => $baseDir . '/lib/public/AppFramework/Http/Attribute/FrontpageRoute.php',
'OCP\\AppFramework\\Http\\Attribute\\IgnoreOpenAPI' => $baseDir . '/lib/public/AppFramework/Http/Attribute/IgnoreOpenAPI.php',
'OCP\\AppFramework\\Http\\Attribute\\NoAdminRequired' => $baseDir . '/lib/public/AppFramework/Http/Attribute/NoAdminRequired.php',
'OCP\\AppFramework\\Http\\Attribute\\NoCSRFRequired' => $baseDir . '/lib/public/AppFramework/Http/Attribute/NoCSRFRequired.php',
'OCP\\AppFramework\\Http\\Attribute\\OpenAPI' => $baseDir . '/lib/public/AppFramework/Http/Attribute/OpenAPI.php',
'OCP\\AppFramework\\Http\\Attribute\\PasswordConfirmationRequired' => $baseDir . '/lib/public/AppFramework/Http/Attribute/PasswordConfirmationRequired.php',
'OCP\\AppFramework\\Http\\Attribute\\PublicPage' => $baseDir . '/lib/public/AppFramework/Http/Attribute/PublicPage.php',
+ 'OCP\\AppFramework\\Http\\Attribute\\Route' => $baseDir . '/lib/public/AppFramework/Http/Attribute/Route.php',
'OCP\\AppFramework\\Http\\Attribute\\StrictCookiesRequired' => $baseDir . '/lib/public/AppFramework/Http/Attribute/StrictCookiesRequired.php',
'OCP\\AppFramework\\Http\\Attribute\\SubAdminRequired' => $baseDir . '/lib/public/AppFramework/Http/Attribute/SubAdminRequired.php',
'OCP\\AppFramework\\Http\\Attribute\\UseSession' => $baseDir . '/lib/public/AppFramework/Http/Attribute/UseSession.php',
diff --git a/lib/composer/composer/autoload_static.php b/lib/composer/composer/autoload_static.php
index b222594af754b..d04b9ce23c563 100644
--- a/lib/composer/composer/autoload_static.php
+++ b/lib/composer/composer/autoload_static.php
@@ -71,15 +71,18 @@ class ComposerStaticInit749170dad3f5e7f9ca158f5a9f04f6a2
'OCP\\AppFramework\\Http' => __DIR__ . '/../../..' . '/lib/public/AppFramework/Http.php',
'OCP\\AppFramework\\Http\\Attribute\\ARateLimit' => __DIR__ . '/../../..' . '/lib/public/AppFramework/Http/Attribute/ARateLimit.php',
'OCP\\AppFramework\\Http\\Attribute\\AnonRateLimit' => __DIR__ . '/../../..' . '/lib/public/AppFramework/Http/Attribute/AnonRateLimit.php',
+ 'OCP\\AppFramework\\Http\\Attribute\\ApiRoute' => __DIR__ . '/../../..' . '/lib/public/AppFramework/Http/Attribute/ApiRoute.php',
'OCP\\AppFramework\\Http\\Attribute\\AuthorizedAdminSetting' => __DIR__ . '/../../..' . '/lib/public/AppFramework/Http/Attribute/AuthorizedAdminSetting.php',
'OCP\\AppFramework\\Http\\Attribute\\BruteForceProtection' => __DIR__ . '/../../..' . '/lib/public/AppFramework/Http/Attribute/BruteForceProtection.php',
'OCP\\AppFramework\\Http\\Attribute\\CORS' => __DIR__ . '/../../..' . '/lib/public/AppFramework/Http/Attribute/CORS.php',
+ 'OCP\\AppFramework\\Http\\Attribute\\FrontpageRoute' => __DIR__ . '/../../..' . '/lib/public/AppFramework/Http/Attribute/FrontpageRoute.php',
'OCP\\AppFramework\\Http\\Attribute\\IgnoreOpenAPI' => __DIR__ . '/../../..' . '/lib/public/AppFramework/Http/Attribute/IgnoreOpenAPI.php',
'OCP\\AppFramework\\Http\\Attribute\\NoAdminRequired' => __DIR__ . '/../../..' . '/lib/public/AppFramework/Http/Attribute/NoAdminRequired.php',
'OCP\\AppFramework\\Http\\Attribute\\NoCSRFRequired' => __DIR__ . '/../../..' . '/lib/public/AppFramework/Http/Attribute/NoCSRFRequired.php',
'OCP\\AppFramework\\Http\\Attribute\\OpenAPI' => __DIR__ . '/../../..' . '/lib/public/AppFramework/Http/Attribute/OpenAPI.php',
'OCP\\AppFramework\\Http\\Attribute\\PasswordConfirmationRequired' => __DIR__ . '/../../..' . '/lib/public/AppFramework/Http/Attribute/PasswordConfirmationRequired.php',
'OCP\\AppFramework\\Http\\Attribute\\PublicPage' => __DIR__ . '/../../..' . '/lib/public/AppFramework/Http/Attribute/PublicPage.php',
+ 'OCP\\AppFramework\\Http\\Attribute\\Route' => __DIR__ . '/../../..' . '/lib/public/AppFramework/Http/Attribute/Route.php',
'OCP\\AppFramework\\Http\\Attribute\\StrictCookiesRequired' => __DIR__ . '/../../..' . '/lib/public/AppFramework/Http/Attribute/StrictCookiesRequired.php',
'OCP\\AppFramework\\Http\\Attribute\\SubAdminRequired' => __DIR__ . '/../../..' . '/lib/public/AppFramework/Http/Attribute/SubAdminRequired.php',
'OCP\\AppFramework\\Http\\Attribute\\UseSession' => __DIR__ . '/../../..' . '/lib/public/AppFramework/Http/Attribute/UseSession.php',
diff --git a/lib/private/AppFramework/Routing/RouteConfig.php b/lib/private/AppFramework/Routing/RouteConfig.php
index 6e3e49e8d9918..7d63e5477ce7c 100644
--- a/lib/private/AppFramework/Routing/RouteConfig.php
+++ b/lib/private/AppFramework/Routing/RouteConfig.php
@@ -136,7 +136,13 @@ protected function processRoute(array $route, string $routeNamePrefix = ''): voi
$controllerName = $this->buildControllerName($controller);
$actionName = $this->buildActionName($action);
- $routeName = $routeNamePrefix . $this->appName . '.' . $controller . '.' . $action . $postfix;
+ /*
+ * The route name has to be lowercase, for symfony to match it correctly.
+ * This is required because smyfony allows mixed casing for controller names in the routes.
+ * To avoid breaking all the existing route names, registering and matching will only use the lowercase names.
+ * This is also safe on the PHP side because class and method names collide regardless of the casing.
+ */
+ $routeName = strtolower($routeNamePrefix . $this->appName . '.' . $controller . '.' . $action . $postfix);
$router = $this->router->create($routeName, $url)
->method($verb);
diff --git a/lib/private/AppFramework/Routing/RouteParser.php b/lib/private/AppFramework/Routing/RouteParser.php
index 1b3a6c1255a42..1b05c23df9d6f 100644
--- a/lib/private/AppFramework/Routing/RouteParser.php
+++ b/lib/private/AppFramework/Routing/RouteParser.php
@@ -100,7 +100,13 @@ private function processRoute(array $route, string $appName, string $routeNamePr
$controllerName = $this->buildControllerName($controller);
$actionName = $this->buildActionName($action);
- $routeName = $routeNamePrefix . $appName . '.' . $controller . '.' . $action . $postfix;
+ /*
+ * The route name has to be lowercase, for symfony to match it correctly.
+ * This is required because smyfony allows mixed casing for controller names in the routes.
+ * To avoid breaking all the existing route names, registering and matching will only use the lowercase names.
+ * This is also safe on the PHP side because class and method names collide regardless of the casing.
+ */
+ $routeName = strtolower($routeNamePrefix . $appName . '.' . $controller . '.' . $action . $postfix);
$routeObject = new Route($url);
$routeObject->method($verb);
diff --git a/lib/private/Route/Router.php b/lib/private/Route/Router.php
index 65bbf602be0d6..e7e2a9f0e49cb 100644
--- a/lib/private/Route/Router.php
+++ b/lib/private/Route/Router.php
@@ -14,6 +14,7 @@
* @author Robin McCorkell
* @author Roeland Jago Douma
* @author Thomas Müller
+ * @author Kate Döen
*
* @license AGPL-3.0
*
@@ -32,8 +33,10 @@
*/
namespace OC\Route;
+use DirectoryIterator;
use OC\AppFramework\Routing\RouteParser;
use OCP\AppFramework\App;
+use OCP\AppFramework\Http\Attribute\Route as RouteAttribute;
use OCP\Diagnostics\IEventLogger;
use OCP\IConfig;
use OCP\IRequest;
@@ -41,6 +44,9 @@
use OCP\Util;
use Psr\Container\ContainerInterface;
use Psr\Log\LoggerInterface;
+use ReflectionAttribute;
+use ReflectionClass;
+use ReflectionException;
use Symfony\Component\Routing\Exception\ResourceNotFoundException;
use Symfony\Component\Routing\Exception\RouteNotFoundException;
use Symfony\Component\Routing\Generator\UrlGenerator;
@@ -150,6 +156,22 @@ public function loadRoutes($app = null) {
}
}
$this->eventLogger->start('route:load:' . $requestedApp, 'Loading Routes for ' . $requestedApp);
+
+ if ($requestedApp !== null) {
+ $routes = $this->getAttributeRoutes($requestedApp);
+ if (count($routes) > 0) {
+ $this->useCollection($requestedApp);
+ $this->setupRoutes($routes, $requestedApp);
+ $collection = $this->getCollection($requestedApp);
+ $this->root->addCollection($collection);
+
+ // Also add the OCS collection
+ $collection = $this->getCollection($requestedApp . '.ocs');
+ $collection->addPrefix('/ocsapp');
+ $this->root->addCollection($collection);
+ }
+ }
+
foreach ($routingFiles as $app => $file) {
if (!isset($this->loadedApps[$app])) {
if (!\OC_App::isAppLoaded($app)) {
@@ -173,6 +195,7 @@ public function loadRoutes($app = null) {
if (!isset($this->loadedApps['core'])) {
$this->loadedApps['core'] = true;
$this->useCollection('root');
+ $this->setupRoutes($this->getAttributeRoutes('core'), 'core');
require_once __DIR__ . '/../../../core/routes.php';
// Also add the OCS collection
@@ -360,6 +383,13 @@ public function generate($name,
if ($absolute === false) {
$referenceType = UrlGenerator::ABSOLUTE_PATH;
}
+ /*
+ * The route name has to be lowercase, for symfony to match it correctly.
+ * This is required because smyfony allows mixed casing for controller names in the routes.
+ * To avoid breaking all the existing route names, registering and matching will only use the lowercase names.
+ * This is also safe on the PHP side because class and method names collide regardless of the casing.
+ */
+ $name = strtolower($name);
$name = $this->fixLegacyRootName($name);
if (str_contains($name, '.')) {
[$appName, $other] = explode('.', $name, 3);
@@ -385,33 +415,78 @@ public function generate($name,
}
protected function fixLegacyRootName(string $routeName): string {
- if ($routeName === 'files.viewcontroller.showFile') {
- return 'files.View.showFile';
+ if ($routeName === 'files.viewcontroller.showfile') {
+ return 'files.view.showfile';
}
- if ($routeName === 'files_sharing.sharecontroller.showShare') {
- return 'files_sharing.Share.showShare';
+ if ($routeName === 'files_sharing.sharecontroller.showshare') {
+ return 'files_sharing.share.showshare';
}
- if ($routeName === 'files_sharing.sharecontroller.showAuthenticate') {
- return 'files_sharing.Share.showAuthenticate';
+ if ($routeName === 'files_sharing.sharecontroller.showauthenticate') {
+ return 'files_sharing.share.showauthenticate';
}
if ($routeName === 'files_sharing.sharecontroller.authenticate') {
- return 'files_sharing.Share.authenticate';
+ return 'files_sharing.share.authenticate';
}
- if ($routeName === 'files_sharing.sharecontroller.downloadShare') {
- return 'files_sharing.Share.downloadShare';
+ if ($routeName === 'files_sharing.sharecontroller.downloadshare') {
+ return 'files_sharing.share.downloadshare';
}
- if ($routeName === 'files_sharing.publicpreview.directLink') {
- return 'files_sharing.PublicPreview.directLink';
+ if ($routeName === 'files_sharing.publicpreview.directlink') {
+ return 'files_sharing.publicpreview.directlink';
}
- if ($routeName === 'cloud_federation_api.requesthandlercontroller.addShare') {
- return 'cloud_federation_api.RequestHandler.addShare';
+ if ($routeName === 'cloud_federation_api.requesthandlercontroller.addshare') {
+ return 'cloud_federation_api.requesthandler.addshare';
}
- if ($routeName === 'cloud_federation_api.requesthandlercontroller.receiveNotification') {
- return 'cloud_federation_api.RequestHandler.receiveNotification';
+ if ($routeName === 'cloud_federation_api.requesthandlercontroller.receivenotification') {
+ return 'cloud_federation_api.requesthandler.receivenotification';
}
return $routeName;
}
+ /**
+ * @throws ReflectionException
+ */
+ private function getAttributeRoutes(string $app): array {
+ $routes = [];
+
+ if ($app === 'core') {
+ $appControllerPath = __DIR__ . '/../../../core/Controller';
+ $appNameSpace = 'OC\\Core';
+ } else {
+ $appControllerPath = \OC_App::getAppPath($app) . '/lib/Controller';
+ $appNameSpace = App::buildAppNamespace($app);
+ }
+
+ if (!file_exists($appControllerPath)) {
+ return [];
+ }
+
+ $dir = new DirectoryIterator($appControllerPath);
+ foreach ($dir as $file) {
+ if (!str_ends_with($file->getPathname(), 'Controller.php')) {
+ continue;
+ }
+
+ $class = new ReflectionClass($appNameSpace . '\\Controller\\' . basename($file->getPathname(), '.php'));
+
+ foreach ($class->getMethods() as $method) {
+ foreach ($method->getAttributes(RouteAttribute::class, ReflectionAttribute::IS_INSTANCEOF) as $attribute) {
+ $route = $attribute->newInstance();
+
+ $serializedRoute = $route->toArray();
+ // Remove 'Controller' suffix
+ $serializedRoute['name'] = substr($class->getShortName(), 0, -10) . '#' . $method->getName();
+
+ $key = $route->getType();
+
+ $routes[$key] ??= [];
+ $routes[$key][] = $serializedRoute;
+ }
+ }
+ }
+
+ return $routes;
+ }
+
/**
* To isolate the variable scope used inside the $file it is required in it's own method
*
diff --git a/lib/public/AppFramework/Http/Attribute/ApiRoute.php b/lib/public/AppFramework/Http/Attribute/ApiRoute.php
new file mode 100644
index 0000000000000..0b566082521d6
--- /dev/null
+++ b/lib/public/AppFramework/Http/Attribute/ApiRoute.php
@@ -0,0 +1,63 @@
+
+ *
+ * @author Kate Döen
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see .
+ */
+
+namespace OCP\AppFramework\Http\Attribute;
+
+use Attribute;
+
+/**
+ * This attribute can be used to define API routes on controller methods.
+ *
+ * It works in addition to the traditional routes.php method and has the same parameters
+ * (except for the `name` parameter which is not needed).
+ *
+ * @since 29.0.0
+ */
+#[Attribute(Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)]
+class ApiRoute extends Route {
+ /**
+ * @inheritDoc
+ *
+ * @since 29.0.0
+ */
+ public function __construct(
+ protected string $verb,
+ protected string $url,
+ protected ?array $requirements = null,
+ protected ?array $defaults = null,
+ protected ?string $root = null,
+ protected ?string $postfix = null,
+ ) {
+ parent::__construct(
+ Route::TYPE_API,
+ $verb,
+ $url,
+ $requirements,
+ $defaults,
+ $root,
+ $postfix,
+ );
+ }
+}
diff --git a/lib/public/AppFramework/Http/Attribute/FrontpageRoute.php b/lib/public/AppFramework/Http/Attribute/FrontpageRoute.php
new file mode 100644
index 0000000000000..ac08513a2a9fb
--- /dev/null
+++ b/lib/public/AppFramework/Http/Attribute/FrontpageRoute.php
@@ -0,0 +1,63 @@
+
+ *
+ * @author Kate Döen
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see .
+ */
+
+namespace OCP\AppFramework\Http\Attribute;
+
+use Attribute;
+
+/**
+ * This attribute can be used to define Frontpage routes on controller methods.
+ *
+ * It works in addition to the traditional routes.php method and has the same parameters
+ * (except for the `name` parameter which is not needed).
+ *
+ * @since 29.0.0
+ */
+#[Attribute(Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)]
+class FrontpageRoute extends Route {
+ /**
+ * @inheritDoc
+ *
+ * @since 29.0.0
+ */
+ public function __construct(
+ protected string $verb,
+ protected string $url,
+ protected ?array $requirements = null,
+ protected ?array $defaults = null,
+ protected ?string $root = null,
+ protected ?string $postfix = null,
+ ) {
+ parent::__construct(
+ Route::TYPE_FRONTPAGE,
+ $verb,
+ $url,
+ $requirements,
+ $defaults,
+ $root,
+ $postfix,
+ );
+ }
+}
diff --git a/lib/public/AppFramework/Http/Attribute/Route.php b/lib/public/AppFramework/Http/Attribute/Route.php
new file mode 100644
index 0000000000000..58579c1f956c6
--- /dev/null
+++ b/lib/public/AppFramework/Http/Attribute/Route.php
@@ -0,0 +1,161 @@
+
+ *
+ * @author Kate Döen
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see .
+ */
+
+namespace OCP\AppFramework\Http\Attribute;
+
+use Attribute;
+
+/**
+ * This attribute can be used to define routes on controller methods.
+ *
+ * It works in addition to the traditional routes.php method and has the same parameters
+ * (except for the `name` parameter which is not needed).
+ *
+ * @since 29.0.0
+ */
+#[Attribute(Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)]
+class Route {
+
+ /**
+ * Corresponds to the `ocs` key in routes.php
+ *
+ * @see ApiRoute
+ * @since 29.0.0
+ */
+ public const TYPE_API = 'ocs';
+
+ /**
+ * Corresponds to the `routes` key in routes.php
+ *
+ * @see FrontpageRoute
+ * @since 29.0.0
+ */
+ public const TYPE_FRONTPAGE = 'routes';
+
+ /**
+ * @param string $type Either Route::TYPE_API or Route::TYPE_FRONTPAGE.
+ * @psalm-param Route::TYPE_* $type
+ * @param string $verb HTTP method of the route.
+ * @psalm-param 'GET'|'HEAD'|'POST'|'PUT'|'DELETE'|'OPTIONS'|'PATCH' $verb
+ * @param string $url The path of the route.
+ * @param ?array $requirements Array of regexes mapped to the path parameters.
+ * @param ?array $defaults Array of default values mapped to the path parameters.
+ * @param ?string $root Custom root. For OCS all apps are allowed, but for index.php only some can use it.
+ * @param ?string $postfix Postfix for the route name.
+ * @since 29.0.0
+ */
+ public function __construct(
+ protected string $type,
+ protected string $verb,
+ protected string $url,
+ protected ?array $requirements = null,
+ protected ?array $defaults = null,
+ protected ?string $root = null,
+ protected ?string $postfix = null,
+ ) {
+ }
+
+ /**
+ * @return array{
+ * verb: string,
+ * url: string,
+ * requirements?: array,
+ * defaults?: array,
+ * root?: string,
+ * postfix?: string,
+ * }
+ * @since 29.0.0
+ */
+ public function toArray() {
+ $route = [
+ 'verb' => $this->verb,
+ 'url' => $this->url,
+ ];
+
+ if ($this->requirements !== null) {
+ $route['requirements'] = $this->requirements;
+ }
+ if ($this->defaults !== null) {
+ $route['defaults'] = $this->defaults;
+ }
+ if ($this->root !== null) {
+ $route['root'] = $this->root;
+ }
+ if ($this->postfix !== null) {
+ $route['postfix'] = $this->postfix;
+ }
+
+ return $route;
+ }
+
+ /**
+ * @since 29.0.0
+ */
+ public function getType(): string {
+ return $this->type;
+ }
+
+ /**
+ * @since 29.0.0
+ */
+ public function getVerb(): string {
+ return $this->verb;
+ }
+
+ /**
+ * @since 29.0.0
+ */
+ public function getUrl(): string {
+ return $this->url;
+ }
+
+ /**
+ * @since 29.0.0
+ */
+ public function getRequirements(): ?array {
+ return $this->requirements;
+ }
+
+ /**
+ * @since 29.0.0
+ */
+ public function getDefaults(): ?array {
+ return $this->defaults;
+ }
+
+ /**
+ * @since 29.0.0
+ */
+ public function getRoot(): ?string {
+ return $this->root;
+ }
+
+ /**
+ * @since 29.0.0
+ */
+ public function getPostfix(): ?string {
+ return $this->postfix;
+ }
+}
diff --git a/vendor-bin/openapi-extractor/composer.lock b/vendor-bin/openapi-extractor/composer.lock
index d9abadb8d2c24..e6c94e495a1e4 100644
--- a/vendor-bin/openapi-extractor/composer.lock
+++ b/vendor-bin/openapi-extractor/composer.lock
@@ -8,16 +8,16 @@
"packages": [
{
"name": "adhocore/cli",
- "version": "v1.6.1",
+ "version": "v1.6.2",
"source": {
"type": "git",
"url": "https://github.com/adhocore/php-cli.git",
- "reference": "25b5a93e5eebcdb70e20ee33313a011ea3a4f770"
+ "reference": "34191315b0da20b9b4ecad783d91db992fa209a4"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/adhocore/php-cli/zipball/25b5a93e5eebcdb70e20ee33313a011ea3a4f770",
- "reference": "25b5a93e5eebcdb70e20ee33313a011ea3a4f770",
+ "url": "https://api.github.com/repos/adhocore/php-cli/zipball/34191315b0da20b9b4ecad783d91db992fa209a4",
+ "reference": "34191315b0da20b9b4ecad783d91db992fa209a4",
"shasum": ""
},
"require": {
@@ -62,7 +62,7 @@
],
"support": {
"issues": "https://github.com/adhocore/php-cli/issues",
- "source": "https://github.com/adhocore/php-cli/tree/v1.6.1"
+ "source": "https://github.com/adhocore/php-cli/tree/v1.6.2"
},
"funding": [
{
@@ -74,7 +74,7 @@
"type": "github"
}
],
- "time": "2023-06-26T09:55:29+00:00"
+ "time": "2024-01-22T22:37:23+00:00"
},
{
"name": "nextcloud/openapi-extractor",
@@ -82,12 +82,12 @@
"source": {
"type": "git",
"url": "https://github.com/nextcloud/openapi-extractor.git",
- "reference": "3b7b6ff9659a5f15612d4749e085bbcb83509049"
+ "reference": "e15283dc655436460c531ce286b7f0bae3e0bf31"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/nextcloud/openapi-extractor/zipball/3b7b6ff9659a5f15612d4749e085bbcb83509049",
- "reference": "3b7b6ff9659a5f15612d4749e085bbcb83509049",
+ "url": "https://api.github.com/repos/nextcloud/openapi-extractor/zipball/e15283dc655436460c531ce286b7f0bae3e0bf31",
+ "reference": "e15283dc655436460c531ce286b7f0bae3e0bf31",
"shasum": ""
},
"require": {
@@ -129,7 +129,7 @@
"source": "https://github.com/nextcloud/openapi-extractor/tree/main",
"issues": "https://github.com/nextcloud/openapi-extractor/issues"
},
- "time": "2024-01-18T14:53:21+00:00"
+ "time": "2024-02-21T11:05:43+00:00"
},
{
"name": "nikic/php-parser",