-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: provokateurin <[email protected]>
- Loading branch information
1 parent
69ff6d5
commit 48cb793
Showing
5 changed files
with
383 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace OCA\Notifications\Controller; | ||
|
||
use OCP\AppFramework\Http; | ||
use OCP\AppFramework\Http\Attribute\ExAppRequired; | ||
use OCP\AppFramework\Http\Attribute\NoAdminRequired; | ||
use OCP\AppFramework\Http\Attribute\OpenAPI; | ||
use OCP\AppFramework\Http\DataResponse; | ||
use OCP\AppFramework\OCSController; | ||
|
||
class ExAppSettingsController extends OCSController { | ||
/** | ||
* Route is in ex_app scope because of the attribute | ||
* | ||
* @return DataResponse<Http::STATUS_OK, array<empty>, array{}> | ||
* | ||
* 200: Personal settings updated | ||
*/ | ||
#[ExAppRequired] | ||
public function exAppScopeAttribute(): DataResponse { | ||
return new DataResponse(); | ||
} | ||
|
||
/** | ||
* Route is in ex_app scope because of the override | ||
* | ||
* @return DataResponse<Http::STATUS_OK, array<empty>, array{}> | ||
* | ||
* 200: Personal settings updated | ||
*/ | ||
#[NoAdminRequired] | ||
#[OpenAPI(OpenAPI::SCOPE_EX_APP)] | ||
public function exAppScopeOverride(): DataResponse { | ||
return new DataResponse(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,195 @@ | ||
{ | ||
"openapi": "3.0.3", | ||
"info": { | ||
"title": "notifications-ex_app", | ||
"version": "0.0.1", | ||
"description": "This app provides a backend and frontend for the notification API available in Nextcloud.", | ||
"license": { | ||
"name": "agpl" | ||
} | ||
}, | ||
"components": { | ||
"securitySchemes": { | ||
"basic_auth": { | ||
"type": "http", | ||
"scheme": "basic" | ||
}, | ||
"bearer_auth": { | ||
"type": "http", | ||
"scheme": "bearer" | ||
} | ||
}, | ||
"schemas": { | ||
"OCSMeta": { | ||
"type": "object", | ||
"required": [ | ||
"status", | ||
"statuscode" | ||
], | ||
"properties": { | ||
"status": { | ||
"type": "string" | ||
}, | ||
"statuscode": { | ||
"type": "integer" | ||
}, | ||
"message": { | ||
"type": "string" | ||
}, | ||
"totalitems": { | ||
"type": "string" | ||
}, | ||
"itemsperpage": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"paths": { | ||
"/ocs/v2.php/apps/notifications/api/{apiVersion}/ex-app-attribute": { | ||
"post": { | ||
"operationId": "ex_app_settings-ex-app-scope-attribute", | ||
"summary": "Route is in ex_app scope because of the attribute", | ||
"description": "This endpoint requires admin access", | ||
"tags": [ | ||
"ex_app_settings" | ||
], | ||
"security": [ | ||
{ | ||
"bearer_auth": [] | ||
}, | ||
{ | ||
"basic_auth": [] | ||
} | ||
], | ||
"parameters": [ | ||
{ | ||
"name": "apiVersion", | ||
"in": "path", | ||
"required": true, | ||
"schema": { | ||
"type": "string", | ||
"enum": [ | ||
"v2" | ||
], | ||
"default": "v2" | ||
} | ||
}, | ||
{ | ||
"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": "Personal settings updated", | ||
"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/notifications/api/{apiVersion}/ex-app-override": { | ||
"post": { | ||
"operationId": "ex_app_settings-ex-app-scope-override", | ||
"summary": "Route is in ex_app scope because of the override", | ||
"tags": [ | ||
"ex_app_settings" | ||
], | ||
"security": [ | ||
{ | ||
"bearer_auth": [] | ||
}, | ||
{ | ||
"basic_auth": [] | ||
} | ||
], | ||
"parameters": [ | ||
{ | ||
"name": "apiVersion", | ||
"in": "path", | ||
"required": true, | ||
"schema": { | ||
"type": "string", | ||
"enum": [ | ||
"v2" | ||
], | ||
"default": "v2" | ||
} | ||
}, | ||
{ | ||
"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": "Personal settings updated", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"type": "object", | ||
"required": [ | ||
"ocs" | ||
], | ||
"properties": { | ||
"ocs": { | ||
"type": "object", | ||
"required": [ | ||
"meta", | ||
"data" | ||
], | ||
"properties": { | ||
"meta": { | ||
"$ref": "#/components/schemas/OCSMeta" | ||
}, | ||
"data": {} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"tags": [] | ||
} |
Oops, something went wrong.