Skip to content

Commit 7800142

Browse files
committed
fix REUSE issue and gen openAPI specs
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
1 parent 16d58a3 commit 7800142

File tree

3 files changed

+147
-3
lines changed

3 files changed

+147
-3
lines changed

lib/Controller/AssistantApiController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ public function saveOutputFile(int $ocpTaskId, int $fileId): DataResponse {
272272
$info = $this->assistantService->saveOutputFile($this->userId, $ocpTaskId, $fileId);
273273
return new DataResponse($info);
274274
} catch (\Exception $e) {
275-
$this->logger->debug('Failed to save assistant output file', ['exception' => $e]);
275+
$this->logger->error('Failed to save assistant output file', ['exception' => $e]);
276276
return new DataResponse(['error' => $e->getMessage()], Http::STATUS_NOT_FOUND);
277277
}
278278
}

openapi.json

Lines changed: 142 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,7 +1253,7 @@
12531253
"post": {
12541254
"operationId": "assistant_api-share-output-file",
12551255
"summary": "Share an output file",
1256-
"description": "Share a file that was produced by a task",
1256+
"description": "Save and share a file that was produced by a task",
12571257
"tags": [
12581258
"assistant_api"
12591259
],
@@ -1311,7 +1311,147 @@
13111311
],
13121312
"responses": {
13131313
"200": {
1314-
"description": "The file was shared",
1314+
"description": "The file was saved and shared",
1315+
"content": {
1316+
"application/json": {
1317+
"schema": {
1318+
"type": "object",
1319+
"required": [
1320+
"ocs"
1321+
],
1322+
"properties": {
1323+
"ocs": {
1324+
"type": "object",
1325+
"required": [
1326+
"meta",
1327+
"data"
1328+
],
1329+
"properties": {
1330+
"meta": {
1331+
"$ref": "#/components/schemas/OCSMeta"
1332+
},
1333+
"data": {
1334+
"type": "object",
1335+
"required": [
1336+
"shareToken"
1337+
],
1338+
"properties": {
1339+
"shareToken": {
1340+
"type": "string"
1341+
}
1342+
}
1343+
}
1344+
}
1345+
}
1346+
}
1347+
}
1348+
}
1349+
}
1350+
},
1351+
"404": {
1352+
"description": "The file was not found",
1353+
"content": {
1354+
"application/json": {
1355+
"schema": {
1356+
"type": "object",
1357+
"required": [
1358+
"ocs"
1359+
],
1360+
"properties": {
1361+
"ocs": {
1362+
"type": "object",
1363+
"required": [
1364+
"meta",
1365+
"data"
1366+
],
1367+
"properties": {
1368+
"meta": {
1369+
"$ref": "#/components/schemas/OCSMeta"
1370+
},
1371+
"data": {
1372+
"type": "object",
1373+
"required": [
1374+
"error"
1375+
],
1376+
"properties": {
1377+
"error": {
1378+
"type": "string"
1379+
}
1380+
}
1381+
}
1382+
}
1383+
}
1384+
}
1385+
}
1386+
}
1387+
}
1388+
}
1389+
}
1390+
}
1391+
},
1392+
"/ocs/v2.php/apps/assistant/api/{apiVersion}/task/{ocpTaskId}/file/{fileId}/save": {
1393+
"post": {
1394+
"operationId": "assistant_api-save-output-file",
1395+
"summary": "Save an output file",
1396+
"description": "Save a file that was produced by a task",
1397+
"tags": [
1398+
"assistant_api"
1399+
],
1400+
"security": [
1401+
{
1402+
"bearer_auth": []
1403+
},
1404+
{
1405+
"basic_auth": []
1406+
}
1407+
],
1408+
"parameters": [
1409+
{
1410+
"name": "apiVersion",
1411+
"in": "path",
1412+
"required": true,
1413+
"schema": {
1414+
"type": "string",
1415+
"enum": [
1416+
"v1"
1417+
],
1418+
"default": "v1"
1419+
}
1420+
},
1421+
{
1422+
"name": "ocpTaskId",
1423+
"in": "path",
1424+
"description": "The task ID",
1425+
"required": true,
1426+
"schema": {
1427+
"type": "integer",
1428+
"format": "int64"
1429+
}
1430+
},
1431+
{
1432+
"name": "fileId",
1433+
"in": "path",
1434+
"description": "The file ID",
1435+
"required": true,
1436+
"schema": {
1437+
"type": "integer",
1438+
"format": "int64"
1439+
}
1440+
},
1441+
{
1442+
"name": "OCS-APIRequest",
1443+
"in": "header",
1444+
"description": "Required to be true for the API request to pass",
1445+
"required": true,
1446+
"schema": {
1447+
"type": "boolean",
1448+
"default": true
1449+
}
1450+
}
1451+
],
1452+
"responses": {
1453+
"200": {
1454+
"description": "The file was saved",
13151455
"content": {
13161456
"application/json": {
13171457
"schema": {

src/views/TaskOutputFileReferenceWidget.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
<!--
2+
- SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
3+
- SPDX-License-Identifier: AGPL-3.0-or-later
4+
-->
15
<template>
26
<div class="task-output-widget">
37
<MediaField :field="field"

0 commit comments

Comments
 (0)