diff options
author | Richard Steinmetz <richard@steinmetz.cloud> | 2023-08-17 15:09:30 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2023-08-22 08:36:53 +0200 |
commit | 6982597b6a6d319dacfbe3bee2edd2a39b3d6d68 (patch) | |
tree | 9a3cfc98c5ce08542e204ef37365491fa0a0404e /apps/dashboard/openapi.json | |
parent | 82835eaa4623180c41dad927b0ac1db1ed449362 (diff) | |
download | nextcloud-server-6982597b6a6d319dacfbe3bee2edd2a39b3d6d68.tar.gz nextcloud-server-6982597b6a6d319dacfbe3bee2edd2a39b3d6d68.zip |
feat(dashboard): implement widget item api v2
This API enables the dashboard to render all widgets from the API data
alone without having apps to provide their own bundles. This saves a lot
of traffic and execution time as a lot less javascript has to be parsed
on the frontend.
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
Diffstat (limited to 'apps/dashboard/openapi.json')
-rw-r--r-- | apps/dashboard/openapi.json | 134 |
1 files changed, 133 insertions, 1 deletions
diff --git a/apps/dashboard/openapi.json b/apps/dashboard/openapi.json index 594aed76793..739ba2c4afc 100644 --- a/apps/dashboard/openapi.json +++ b/apps/dashboard/openapi.json @@ -53,7 +53,9 @@ "icon_class", "icon_url", "widget_url", - "item_icons_round" + "item_icons_round", + "item_api_versions", + "reload_interval" ], "properties": { "id": { @@ -79,6 +81,17 @@ "item_icons_round": { "type": "boolean" }, + "item_api_versions": { + "type": "array", + "items": { + "type": "integer", + "format": "int64" + } + }, + "reload_interval": { + "type": "integer", + "format": "int64" + }, "buttons": { "type": "array", "items": { @@ -110,6 +123,7 @@ "title", "link", "iconUrl", + "overlayIconUrl", "sinceId" ], "properties": { @@ -125,10 +139,35 @@ "iconUrl": { "type": "string" }, + "overlayIconUrl": { + "type": "string" + }, "sinceId": { "type": "string" } } + }, + "WidgetItems": { + "type": "object", + "required": [ + "items", + "emptyContentMessage", + "halfEmptyContentMessage" + ], + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/WidgetItem" + } + }, + "emptyContentMessage": { + "type": "string" + }, + "halfEmptyContentMessage": { + "type": "string" + } + } } } }, @@ -291,6 +330,99 @@ } } } + }, + "/ocs/v2.php/apps/dashboard/api/v2/widget-items": { + "get": { + "operationId": "dashboard_api-get-widget-items-v2", + "summary": "Get the items for the widgets", + "tags": [ + "dashboard_api" + ], + "security": [ + { + "bearer_auth": [] + }, + { + "basic_auth": [] + } + ], + "parameters": [ + { + "name": "sinceIds", + "in": "query", + "description": "Array indexed by widget Ids, contains date/id from which we want the new items", + "schema": { + "type": "string" + } + }, + { + "name": "limit", + "in": "query", + "description": "Limit number of result items per widget", + "schema": { + "type": "integer", + "format": "int64", + "default": 7 + } + }, + { + "name": "widgets[]", + "in": "query", + "description": "Limit results to specific widgets", + "schema": { + "type": "array", + "default": [], + "items": { + "type": "string" + } + } + }, + { + "name": "OCS-APIRequest", + "in": "header", + "required": true, + "schema": { + "type": "string", + "default": "true" + } + } + ], + "responses": { + "200": { + "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", + "additionalProperties": { + "$ref": "#/components/schemas/WidgetItems" + } + } + } + } + } + } + } + } + } + } + } } }, "tags": [] |