diff --git a/lib/Controller/ContextController.php b/lib/Controller/ContextController.php index bc7a31000..897c69d0b 100644 --- a/lib/Controller/ContextController.php +++ b/lib/Controller/ContextController.php @@ -59,8 +59,9 @@ public function index(): DataResponse { } /** - * [api v3] Get information about the requests context + * [api v2] Get information about the requests context * + * @param int $contextId ID of the context * @return DataResponse|DataResponse * * 200: returning the full context information @@ -87,11 +88,11 @@ public function show(int $contextId): DataResponse { * @param string $name Name of the context * @param string $iconName Material design icon name of the context * @param string $description Descriptive text of the context - * @param array $nodes optional nodes to be connected to this context + * @param array{id: int, type: int, permissions: int} $nodes optional nodes to be connected to this context * * @return DataResponse|DataResponse * - * 200: Tables returned + * 200: returning the full context information */ public function create(string $name, string $iconName, string $description = '', array $nodes = []): DataResponse { try { @@ -102,6 +103,20 @@ public function create(string $name, string $iconName, string $description = '', } /** + * [api v2] Update an existing context and return it + * + * @param int $contextId ID of the context + * @param ?string $name provide this parameter to set a new name + * @param ?string $iconName provide this parameter to set a new icon + * @param ?string $description provide this parameter to set a new description + * @param ?array{id: int, type: int, permissions: int, order: int} $nodes provide this parameter to set a new list of nodes. + * + * @return DataResponse|DataResponse + * + * 200: returning the full context information + * 403: No permissions + * 404: Not found + * * @NoAdminRequired * @CanManageContext */ @@ -123,6 +138,19 @@ public function update(int $contextId, ?string $name, ?string $iconName, ?string } /** + * [api v2] Transfer the ownership of a context and return it + * + * @param int $contextId ID of the context + * @param string $newOwnerId ID of the new owner + * @param int $newOwnerType any Application::OWNER_TYPE_* constant + * + * @return DataResponse|DataResponse + * + * 200: Ownership transferred + * 400: Invalid request + * 403: No permissions + * 404: Not found + * * @NoAdminRequired * @CanManageContext * @@ -142,6 +170,20 @@ public function transfer(int $contextId, string $newOwnerId, int $newOwnerType = } /** + * [api v2] Add a node to a Context + * + * @param int $contextId ID of the context + * @param int $nodeId ID of the node + * @param int $nodeType any Application::NODE_TYPE_* constant + * @param int $permissions bitmask of the permissions for context recipients + * @param ?int $order in which order the node should appear within the context + * + * @return DataResponse|DataResponse + * + * 200: Node added successfully + * 403: No permissions + * 404: Not found + * * @NoAdminRequired * @CanManageNode */ @@ -151,6 +193,8 @@ public function addNode(int $contextId, int $nodeId, int $nodeType, int $permiss $this->contextService->addNodeRelToPage($rel, $order); $context = $this->contextService->findById($rel->getContextId(), $this->userId); return new DataResponse($context->jsonSerialize()); + } catch (NotFoundError $e) { + return $this->handleNotFoundError($e); } catch (DoesNotExistException $e) { return $this->handleNotFoundError(new NotFoundError($e->getMessage(), $e->getCode(), $e)); } catch (MultipleObjectsReturnedException|Exception|InternalError $e) { @@ -159,6 +203,17 @@ public function addNode(int $contextId, int $nodeId, int $nodeType, int $permiss } /** + * [api v2] Remove a node from a Context + * + * @param int $contextId ID of the context + * @param int $nodeRelId ID of the node-in-context relation + * + * @return DataResponse|DataResponse + * + * 200: Node removed successfully + * 403: No permissions + * 404: Not found + * * @NoAdminRequired * @CanManageContext */ @@ -174,21 +229,40 @@ public function removeNode(int $contextId, int $nodeRelId): DataResponse { $this->contextService->removeNodeRelFromAllPages($nodeRelation); $context = $this->contextService->findById($contextId, $this->userId); return new DataResponse($context->jsonSerialize()); + } catch (NotFoundError $e) { + return $this->handleNotFoundError($e); } catch (DoesNotExistException $e) { - $this->handleNotFoundError(new NotFoundError($e->getMessage(), $e->getCode(), $e)); - } catch (MultipleObjectsReturnedException|Exception $e) { - $this->handleError($e); + return $this->handleNotFoundError(new NotFoundError($e->getMessage(), $e->getCode(), $e)); + } catch (MultipleObjectsReturnedException|Exception|InternalError $e) { + return $this->handleError($e); } - - return new DataResponse(); } /** + * [api v2] Update the order on a page of a context + * + * @param int $contextId ID of the context + * @param int $pageId ID of the page + * @param array{id: int, order: int} $content content items with it and order values + * + * @return DataResponse|DataResponse + * * @NoAdminRequired * @CanManageContext + * + * 200: content updated successfully + * 400: Invalid request + * 403: No permissions + * 404: Not found */ public function updateContentOrder(int $contextId, int $pageId, array $content): DataResponse { - $context = $this->contextService->findById($contextId, $this->userId); + try { + $context = $this->contextService->findById($contextId, $this->userId); + } catch (Exception|InternalError $e) { + return $this->handleError($e); + } catch (NotFoundError $e) { + return $this->handleNotFoundError($e); + } if (!isset($context->getPages()[$pageId])) { return $this->handleBadRequestError(new BadRequestError('Page not found in given Context')); } diff --git a/lib/Db/ContextMapper.php b/lib/Db/ContextMapper.php index 5b33ec10e..44fb57ae6 100644 --- a/lib/Db/ContextMapper.php +++ b/lib/Db/ContextMapper.php @@ -164,9 +164,8 @@ public function findAll(?string $userId = null): array { } /** - * @throws DoesNotExistException - * @throws MultipleObjectsReturnedException * @throws Exception + * @throws NotFoundError */ public function findById(int $contextId, ?string $userId = null): Context { $qb = $this->getFindContextBaseQuery($userId); diff --git a/lib/Service/ContextService.php b/lib/Service/ContextService.php index 7eccec9d5..ee31cc7ad 100644 --- a/lib/Service/ContextService.php +++ b/lib/Service/ContextService.php @@ -16,6 +16,7 @@ use OCA\Tables\Db\PageMapper; use OCA\Tables\Errors\BadRequestError; use OCA\Tables\Errors\InternalError; +use OCA\Tables\Errors\NotFoundError; use OCA\Tables\Errors\PermissionError; use OCP\AppFramework\Db\DoesNotExistException; use OCP\AppFramework\Db\MultipleObjectsReturnedException; @@ -77,8 +78,9 @@ public function findAll(?string $userId): array { } /** - * @return Context + * @throws Exception * @throws InternalError + * @throws NotFoundError */ public function findById(int $id, ?string $userId): Context { if ($userId !== null && trim($userId) === '') { diff --git a/openapi.json b/openapi.json deleted file mode 100644 index 82b1e5665..000000000 --- a/openapi.json +++ /dev/null @@ -1,7561 +0,0 @@ -{ - "openapi": "3.0.3", - "info": { - "title": "tables", - "version": "0.0.1", - "description": "Manage data the way you need it.", - "license": { - "name": "agpl" - } - }, - "components": { - "securitySchemes": { - "basic_auth": { - "type": "http", - "scheme": "basic" - }, - "bearer_auth": { - "type": "http", - "scheme": "bearer" - } - }, - "schemas": { - "Capabilities": { - "type": "object", - "required": [ - "tables" - ], - "properties": { - "tables": { - "type": "object", - "required": [ - "enabled", - "version", - "apiVersions", - "column_types" - ], - "properties": { - "enabled": { - "type": "boolean" - }, - "version": { - "type": "string" - }, - "apiVersions": { - "type": "array", - "items": { - "type": "string" - } - }, - "column_types": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - } - }, - "Column": { - "type": "object", - "required": [ - "id", - "title", - "tableId", - "createdBy", - "createdAt", - "lastEditBy", - "lastEditAt", - "type", - "subtype", - "mandatory", - "description", - "orderWeight", - "numberDefault", - "numberMin", - "numberMax", - "numberDecimals", - "numberPrefix", - "numberSuffix", - "textDefault", - "textAllowedPattern", - "textMaxLength", - "selectionOptions", - "selectionDefault", - "datetimeDefault" - ], - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "title": { - "type": "string" - }, - "tableId": { - "type": "integer", - "format": "int64" - }, - "createdBy": { - "type": "string" - }, - "createdAt": { - "type": "string" - }, - "lastEditBy": { - "type": "string" - }, - "lastEditAt": { - "type": "string" - }, - "type": { - "type": "string" - }, - "subtype": { - "type": "string" - }, - "mandatory": { - "type": "boolean" - }, - "description": { - "type": "string" - }, - "orderWeight": { - "type": "integer", - "format": "int64" - }, - "numberDefault": { - "type": "number", - "format": "float" - }, - "numberMin": { - "type": "number", - "format": "float" - }, - "numberMax": { - "type": "number", - "format": "float" - }, - "numberDecimals": { - "type": "integer", - "format": "int64" - }, - "numberPrefix": { - "type": "string" - }, - "numberSuffix": { - "type": "string" - }, - "textDefault": { - "type": "string" - }, - "textAllowedPattern": { - "type": "string" - }, - "textMaxLength": { - "type": "integer", - "format": "int64" - }, - "selectionOptions": { - "type": "string" - }, - "selectionDefault": { - "type": "string" - }, - "datetimeDefault": { - "type": "string" - } - } - }, - "Context": { - "type": "object", - "required": [ - "id", - "name", - "iconName", - "description", - "owner", - "ownerType" - ], - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "name": { - "type": "string" - }, - "iconName": { - "type": "string" - }, - "description": { - "type": "string" - }, - "owner": { - "type": "string" - }, - "ownerType": { - "type": "integer", - "format": "int64" - } - } - }, - "ImportState": { - "type": "object", - "required": [ - "found_columns_count", - "matching_columns_count", - "created_columns_count", - "inserted_rows_count", - "errors_parsing_count", - "errors_count" - ], - "properties": { - "found_columns_count": { - "type": "integer", - "format": "int64" - }, - "matching_columns_count": { - "type": "integer", - "format": "int64" - }, - "created_columns_count": { - "type": "integer", - "format": "int64" - }, - "inserted_rows_count": { - "type": "integer", - "format": "int64" - }, - "errors_parsing_count": { - "type": "integer", - "format": "int64" - }, - "errors_count": { - "type": "integer", - "format": "int64" - } - } - }, - "Index": { - "type": "object", - "required": [ - "tables", - "views" - ], - "properties": { - "tables": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Table" - } - }, - "views": { - "type": "array", - "items": { - "$ref": "#/components/schemas/View" - } - } - } - }, - "OCSMeta": { - "type": "object", - "required": [ - "status", - "statuscode" - ], - "properties": { - "status": { - "type": "string" - }, - "statuscode": { - "type": "integer" - }, - "message": { - "type": "string" - }, - "totalitems": { - "type": "string" - }, - "itemsperpage": { - "type": "string" - } - } - }, - "Row": { - "type": "object", - "required": [ - "id", - "tableId", - "createdBy", - "createdAt", - "lastEditBy", - "lastEditAt", - "data" - ], - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "tableId": { - "type": "integer", - "format": "int64" - }, - "createdBy": { - "type": "string" - }, - "createdAt": { - "type": "string" - }, - "lastEditBy": { - "type": "string" - }, - "lastEditAt": { - "type": "string" - }, - "data": { - "type": "object", - "nullable": true, - "required": [ - "columnId", - "value" - ], - "properties": { - "columnId": { - "type": "integer", - "format": "int64" - }, - "value": { - "type": "object" - } - } - } - } - }, - "Share": { - "type": "object", - "required": [ - "id", - "sender", - "receiver", - "receiverDisplayName", - "receiverType", - "nodeId", - "nodeType", - "permissionRead", - "permissionCreate", - "permissionUpdate", - "permissionDelete", - "permissionManage", - "createdAt", - "createdBy" - ], - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "sender": { - "type": "string" - }, - "receiver": { - "type": "string" - }, - "receiverDisplayName": { - "type": "string" - }, - "receiverType": { - "type": "string" - }, - "nodeId": { - "type": "integer", - "format": "int64" - }, - "nodeType": { - "type": "string" - }, - "permissionRead": { - "type": "boolean" - }, - "permissionCreate": { - "type": "boolean" - }, - "permissionUpdate": { - "type": "boolean" - }, - "permissionDelete": { - "type": "boolean" - }, - "permissionManage": { - "type": "boolean" - }, - "createdAt": { - "type": "string" - }, - "createdBy": { - "type": "string" - } - } - }, - "Table": { - "type": "object", - "required": [ - "id", - "title", - "emoji", - "ownership", - "ownerDisplayName", - "createdBy", - "createdAt", - "lastEditBy", - "lastEditAt", - "isShared", - "onSharePermissions", - "hasShares", - "rowsCount", - "views", - "columnsCount" - ], - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "title": { - "type": "string" - }, - "emoji": { - "type": "string", - "nullable": true - }, - "ownership": { - "type": "string" - }, - "ownerDisplayName": { - "type": "string" - }, - "createdBy": { - "type": "string" - }, - "createdAt": { - "type": "string" - }, - "lastEditBy": { - "type": "string" - }, - "lastEditAt": { - "type": "string" - }, - "isShared": { - "type": "boolean" - }, - "onSharePermissions": { - "type": "object", - "nullable": true, - "required": [ - "read", - "create", - "update", - "delete", - "manage" - ], - "properties": { - "read": { - "type": "boolean" - }, - "create": { - "type": "boolean" - }, - "update": { - "type": "boolean" - }, - "delete": { - "type": "boolean" - }, - "manage": { - "type": "boolean" - } - } - }, - "hasShares": { - "type": "boolean" - }, - "rowsCount": { - "type": "integer", - "format": "int64" - }, - "views": { - "type": "array", - "items": { - "$ref": "#/components/schemas/View" - } - }, - "columnsCount": { - "type": "integer", - "format": "int64" - } - } - }, - "View": { - "type": "object", - "required": [ - "id", - "title", - "emoji", - "tableId", - "ownership", - "ownerDisplayName", - "createdBy", - "createdAt", - "lastEditBy", - "lastEditAt", - "description", - "columns", - "sort", - "filter", - "isShared", - "onSharePermissions", - "hasShares", - "rowsCount" - ], - "properties": { - "id": { - "type": "integer", - "format": "int64" - }, - "title": { - "type": "string" - }, - "emoji": { - "type": "string", - "nullable": true - }, - "tableId": { - "type": "integer", - "format": "int64" - }, - "ownership": { - "type": "string" - }, - "ownerDisplayName": { - "type": "string", - "nullable": true - }, - "createdBy": { - "type": "string" - }, - "createdAt": { - "type": "string" - }, - "lastEditBy": { - "type": "string" - }, - "lastEditAt": { - "type": "string" - }, - "description": { - "type": "string", - "nullable": true - }, - "columns": { - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - }, - "sort": { - "type": "array", - "items": { - "type": "object", - "required": [ - "columnId", - "mode" - ], - "properties": { - "columnId": { - "type": "integer", - "format": "int64" - }, - "mode": { - "type": "string", - "enum": [ - "ASC", - "DESC" - ] - } - } - } - }, - "filter": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "object", - "required": [ - "columnId", - "operator", - "value" - ], - "properties": { - "columnId": { - "type": "integer", - "format": "int64" - }, - "operator": { - "type": "string", - "enum": [ - "begins-with", - "ends-with", - "contains", - "is-equal", - "is-greater-than", - "is-greater-than-or-equal", - "is-lower-than", - "is-lower-than-or-equal", - "is-empty" - ] - }, - "value": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer", - "format": "int64" - }, - { - "type": "number", - "format": "float" - } - ] - } - } - } - } - }, - "isShared": { - "type": "boolean" - }, - "onSharePermissions": { - "type": "object", - "nullable": true, - "required": [ - "read", - "create", - "update", - "delete", - "manage" - ], - "properties": { - "read": { - "type": "boolean" - }, - "create": { - "type": "boolean" - }, - "update": { - "type": "boolean" - }, - "delete": { - "type": "boolean" - }, - "manage": { - "type": "boolean" - } - } - }, - "hasShares": { - "type": "boolean" - }, - "rowsCount": { - "type": "integer", - "format": "int64" - } - } - } - } - }, - "paths": { - "/index.php/apps/tables/api/1/tables": { - "get": { - "operationId": "api1-list", - "summary": "Returns all Tables", - "tags": [ - "api1" - ], - "security": [ - { - "basic_auth": [] - } - ], - "responses": { - "200": { - "description": "Tables returned", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Table" - } - } - } - } - }, - "500": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - }, - "post": { - "operationId": "api1-create-table", - "summary": "Create a new table and return it", - "tags": [ - "api1" - ], - "security": [ - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "title", - "in": "query", - "description": "Title of the table", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "emoji", - "in": "query", - "description": "Emoji for the table", - "schema": { - "type": "string", - "nullable": true - } - }, - { - "name": "template", - "in": "query", - "description": "Template to use if wanted", - "schema": { - "type": "string", - "default": "custom" - } - } - ], - "responses": { - "200": { - "description": "Tables returned", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Table" - } - } - } - }, - "500": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - } - }, - "/index.php/apps/tables/api/1/tables/{tableId}": { - "put": { - "operationId": "api1-update-table", - "summary": "Update tables properties", - "tags": [ - "api1" - ], - "security": [ - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "title", - "in": "query", - "description": "New table title", - "schema": { - "type": "string", - "nullable": true - } - }, - { - "name": "emoji", - "in": "query", - "description": "New table emoji", - "schema": { - "type": "string", - "nullable": true - } - }, - { - "name": "tableId", - "in": "path", - "description": "Table ID", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - } - ], - "responses": { - "200": { - "description": "Tables returned", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Table" - } - } - } - }, - "403": { - "description": "No permissions", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - }, - "500": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - }, - "get": { - "operationId": "api1-get-table", - "summary": "Get a table object", - "tags": [ - "api1" - ], - "security": [ - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "tableId", - "in": "path", - "description": "Table ID", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - } - ], - "responses": { - "200": { - "description": "Table returned", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Table" - } - } - } - }, - "403": { - "description": "No permissions", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - }, - "500": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - }, - "delete": { - "operationId": "api1-delete-table", - "summary": "Delete a table", - "tags": [ - "api1" - ], - "security": [ - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "tableId", - "in": "path", - "description": "Table ID", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - } - ], - "responses": { - "200": { - "description": "Deleted table returned", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Table" - } - } - } - }, - "403": { - "description": "No permissions", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - }, - "500": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - } - }, - "/index.php/apps/tables/api/1/tables/{tableId}/views": { - "get": { - "operationId": "api1-list-views", - "summary": "Get all views for a table", - "tags": [ - "api1" - ], - "security": [ - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "tableId", - "in": "path", - "description": "Table ID", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - } - ], - "responses": { - "200": { - "description": "Views returned", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/View" - } - } - } - } - }, - "403": { - "description": "No permissions", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - }, - "500": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - }, - "post": { - "operationId": "api1-create-view", - "summary": "Create a new view for a table", - "tags": [ - "api1" - ], - "security": [ - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "title", - "in": "query", - "description": "Title for the view", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "emoji", - "in": "query", - "description": "Emoji for the view", - "schema": { - "type": "string", - "nullable": true - } - }, - { - "name": "tableId", - "in": "path", - "description": "Table ID that will hold the view", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - } - ], - "responses": { - "200": { - "description": "View created", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/View" - } - } - } - }, - "403": { - "description": "No permissions", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - }, - "500": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - } - }, - "/index.php/apps/tables/api/1/views/{viewId}": { - "get": { - "operationId": "api1-get-view", - "summary": "Get a view object", - "tags": [ - "api1" - ], - "security": [ - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "viewId", - "in": "path", - "description": "View ID", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - } - ], - "responses": { - "200": { - "description": "View returned", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/View" - } - } - } - }, - "403": { - "description": "No permissions", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - }, - "500": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - }, - "put": { - "operationId": "api1-update-view", - "summary": "Update a view via key-value sets", - "tags": [ - "api1" - ], - "security": [ - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "data", - "in": "query", - "description": "key-value pairs", - "required": true, - "schema": { - "oneOf": [ - { - "type": "object", - "required": [ - "key", - "value" - ], - "properties": { - "key": { - "type": "string", - "enum": [ - "title", - "emoji", - "description" - ] - }, - "value": { - "type": "string" - } - } - }, - { - "type": "object", - "required": [ - "key", - "value" - ], - "properties": { - "key": { - "type": "string", - "enum": [ - "columns" - ] - }, - "value": { - "type": "array", - "items": { - "type": "integer", - "format": "int64" - } - } - } - }, - { - "type": "object", - "required": [ - "key", - "value" - ], - "properties": { - "key": { - "type": "string", - "enum": [ - "sort" - ] - }, - "value": { - "type": "object", - "required": [ - "columnId", - "mode" - ], - "properties": { - "columnId": { - "type": "integer", - "format": "int64" - }, - "mode": { - "type": "string", - "enum": [ - "ASC", - "DESC" - ] - } - } - } - } - }, - { - "type": "object", - "required": [ - "key", - "value" - ], - "properties": { - "key": { - "type": "string", - "enum": [ - "filter" - ] - }, - "value": { - "type": "object", - "required": [ - "columnId", - "operator", - "value" - ], - "properties": { - "columnId": { - "type": "integer", - "format": "int64" - }, - "operator": { - "type": "string", - "enum": [ - "begins-with", - "ends-with", - "contains", - "is-equal", - "is-greater-than", - "is-greater-than-or-equal", - "is-lower-than", - "is-lower-than-or-equal", - "is-empty" - ] - }, - "value": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer", - "format": "int64" - }, - { - "type": "number", - "format": "float" - } - ] - } - } - } - } - } - ] - } - }, - { - "name": "viewId", - "in": "path", - "description": "View ID", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - } - ], - "responses": { - "200": { - "description": "View updated", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/View" - } - } - } - }, - "403": { - "description": "No permissions", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - }, - "500": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - }, - "delete": { - "operationId": "api1-delete-view", - "summary": "Delete a view", - "tags": [ - "api1" - ], - "security": [ - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "viewId", - "in": "path", - "description": "View ID", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - } - ], - "responses": { - "200": { - "description": "View deleted", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/View" - } - } - } - }, - "403": { - "description": "No permissions", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - }, - "500": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - } - }, - "/index.php/apps/tables/api/1/shares/{shareId}": { - "get": { - "operationId": "api1-get-share", - "summary": "Get a share object", - "tags": [ - "api1" - ], - "security": [ - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "shareId", - "in": "path", - "description": "Share ID", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - } - ], - "responses": { - "200": { - "description": "Share returned", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Share" - } - } - } - }, - "403": { - "description": "No permissions", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - }, - "500": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - }, - "delete": { - "operationId": "api1-delete-share", - "summary": "Delete a share", - "tags": [ - "api1" - ], - "security": [ - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "shareId", - "in": "path", - "description": "Share ID", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - } - ], - "responses": { - "200": { - "description": "View deleted", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Share" - } - } - } - }, - "403": { - "description": "No permissions", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - }, - "500": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - }, - "put": { - "operationId": "api1-update-share-permissions", - "summary": "Update a share permission", - "tags": [ - "api1" - ], - "security": [ - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "permissionType", - "in": "query", - "description": "Permission type that should be changed", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "permissionValue", - "in": "query", - "description": "New permission value", - "required": true, - "schema": { - "type": "integer", - "enum": [ - 0, - 1 - ] - } - }, - { - "name": "shareId", - "in": "path", - "description": "Share ID", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - } - ], - "responses": { - "200": { - "description": "View deleted", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Share" - } - } - } - }, - "403": { - "description": "No permissions", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - }, - "500": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - } - }, - "/index.php/apps/tables/api/1/views/{viewId}/shares": { - "get": { - "operationId": "api1-list-view-shares", - "summary": "Get all shares for a view Will be empty if view does not exist", - "tags": [ - "api1" - ], - "security": [ - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "viewId", - "in": "path", - "description": "View ID", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - } - ], - "responses": { - "200": { - "description": "Shares returned", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Share" - } - } - } - } - }, - "500": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - } - }, - "/index.php/apps/tables/api/1/tables/{tableId}/shares": { - "get": { - "operationId": "api1-list-table-shares", - "summary": "Get all shares for a table Will be empty if table does not exist", - "tags": [ - "api1" - ], - "security": [ - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "tableId", - "in": "path", - "description": "Table ID", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - } - ], - "responses": { - "200": { - "description": "Shares returned", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Share" - } - } - } - } - }, - "500": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - }, - "post": { - "operationId": "api1-create-table-share", - "summary": "Create a share for a table", - "tags": [ - "api1" - ], - "security": [ - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "receiver", - "in": "query", - "description": "Receiver ID", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "receiverType", - "in": "query", - "description": "Receiver type", - "required": true, - "schema": { - "type": "string", - "enum": [ - "user", - "group" - ] - } - }, - { - "name": "permissionRead", - "in": "query", - "description": "Permission if receiver can read data", - "required": true, - "schema": { - "type": "integer", - "enum": [ - 0, - 1 - ] - } - }, - { - "name": "permissionCreate", - "in": "query", - "description": "Permission if receiver can create data", - "required": true, - "schema": { - "type": "integer", - "enum": [ - 0, - 1 - ] - } - }, - { - "name": "permissionUpdate", - "in": "query", - "description": "Permission if receiver can update data", - "required": true, - "schema": { - "type": "integer", - "enum": [ - 0, - 1 - ] - } - }, - { - "name": "permissionDelete", - "in": "query", - "description": "Permission if receiver can delete data", - "required": true, - "schema": { - "type": "integer", - "enum": [ - 0, - 1 - ] - } - }, - { - "name": "permissionManage", - "in": "query", - "description": "Permission if receiver can manage table", - "required": true, - "schema": { - "type": "integer", - "enum": [ - 0, - 1 - ] - } - }, - { - "name": "tableId", - "in": "path", - "description": "Table ID", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - } - ], - "responses": { - "200": { - "description": "View deleted", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Share" - } - } - } - }, - "403": { - "description": "No permissions", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - }, - "500": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - } - }, - "/index.php/apps/tables/api/1/shares": { - "post": { - "operationId": "api1-create-share", - "summary": "Create a new share", - "tags": [ - "api1" - ], - "security": [ - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "nodeId", - "in": "query", - "description": "Node ID", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "nodeType", - "in": "query", - "description": "Node type", - "required": true, - "schema": { - "type": "string", - "enum": [ - "table", - "view" - ] - } - }, - { - "name": "receiver", - "in": "query", - "description": "Receiver ID", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "receiverType", - "in": "query", - "description": "Receiver type", - "required": true, - "schema": { - "type": "string", - "enum": [ - "user", - "group" - ] - } - }, - { - "name": "permissionRead", - "in": "query", - "description": "Permission if receiver can read data", - "schema": { - "type": "integer", - "default": 0, - "enum": [ - 0, - 1 - ] - } - }, - { - "name": "permissionCreate", - "in": "query", - "description": "Permission if receiver can create data", - "schema": { - "type": "integer", - "default": 0, - "enum": [ - 0, - 1 - ] - } - }, - { - "name": "permissionUpdate", - "in": "query", - "description": "Permission if receiver can update data", - "schema": { - "type": "integer", - "default": 0, - "enum": [ - 0, - 1 - ] - } - }, - { - "name": "permissionDelete", - "in": "query", - "description": "Permission if receiver can delete data", - "schema": { - "type": "integer", - "default": 0, - "enum": [ - 0, - 1 - ] - } - }, - { - "name": "permissionManage", - "in": "query", - "description": "Permission if receiver can manage node", - "schema": { - "type": "integer", - "default": 0, - "enum": [ - 0, - 1 - ] - } - } - ], - "responses": { - "200": { - "description": "Share returned", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Share" - } - } - } - }, - "403": { - "description": "No permissions", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - }, - "500": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - } - }, - "/index.php/apps/tables/api/1/tables/{tableId}/columns": { - "get": { - "operationId": "api1-list-table-columns", - "summary": "Get all columns for a table or a underlying view Return an empty array if no columns were found", - "tags": [ - "api1" - ], - "security": [ - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "viewId", - "in": "query", - "description": "View ID", - "schema": { - "type": "integer", - "format": "int64", - "nullable": true - } - }, - { - "name": "tableId", - "in": "path", - "description": "Table ID", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - } - ], - "responses": { - "200": { - "description": "View deleted", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Column" - } - } - } - } - }, - "403": { - "description": "No permissions", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - }, - "500": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - }, - "post": { - "operationId": "api1-create-table-column", - "summary": "Create a new column for a table", - "tags": [ - "api1" - ], - "security": [ - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "title", - "in": "query", - "description": "Title", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "type", - "in": "query", - "description": "Column main type", - "required": true, - "schema": { - "type": "string", - "enum": [ - "text", - "number", - "datetime", - "select" - ] - } - }, - { - "name": "subtype", - "in": "query", - "description": "Column sub type", - "schema": { - "type": "string", - "nullable": true - } - }, - { - "name": "mandatory", - "in": "query", - "description": "Is the column mandatory", - "required": true, - "schema": { - "type": "integer", - "enum": [ - 0, - 1 - ] - } - }, - { - "name": "description", - "in": "query", - "description": "Description", - "schema": { - "type": "string", - "nullable": true - } - }, - { - "name": "numberPrefix", - "in": "query", - "description": "Prefix if the column is a number field", - "schema": { - "type": "string", - "nullable": true - } - }, - { - "name": "numberSuffix", - "in": "query", - "description": "Suffix if the column is a number field", - "schema": { - "type": "string", - "nullable": true - } - }, - { - "name": "numberDefault", - "in": "query", - "description": "Default number, if column is a number", - "schema": { - "type": "number", - "format": "float", - "nullable": true - } - }, - { - "name": "numberMin", - "in": "query", - "description": "Min value, if column is a number", - "schema": { - "type": "number", - "format": "float", - "nullable": true - } - }, - { - "name": "numberMax", - "in": "query", - "description": "Max number, if column is a number", - "schema": { - "type": "number", - "format": "float", - "nullable": true - } - }, - { - "name": "numberDecimals", - "in": "query", - "description": "Number of decimals, if column is a number", - "schema": { - "type": "integer", - "format": "int64", - "nullable": true - } - }, - { - "name": "textDefault", - "in": "query", - "description": "Default text, if column is a text", - "schema": { - "type": "string", - "nullable": true - } - }, - { - "name": "textAllowedPattern", - "in": "query", - "description": "Allowed pattern (regex) for text columns (not yet implemented)", - "schema": { - "type": "string", - "nullable": true - } - }, - { - "name": "textMaxLength", - "in": "query", - "description": "Max length, if column is a text", - "schema": { - "type": "integer", - "format": "int64", - "nullable": true - } - }, - { - "name": "selectionOptions", - "in": "query", - "description": "Options for a selection (json array{id: int, label: string})", - "schema": { - "type": "string", - "nullable": true, - "default": "" - } - }, - { - "name": "selectionDefault", - "in": "query", - "description": "Default option IDs for a selection (json int[])", - "schema": { - "type": "string", - "nullable": true, - "default": "" - } - }, - { - "name": "datetimeDefault", - "in": "query", - "description": "Default value, if column is datetime", - "schema": { - "type": "string", - "nullable": true, - "default": "" - } - }, - { - "name": "selectedViewIds[]", - "in": "query", - "description": "View IDs where this column should be added to be presented", - "schema": { - "type": "array", - "nullable": true, - "default": [], - "items": { - "type": "integer", - "format": "int64" - } - } - }, - { - "name": "tableId", - "in": "path", - "description": "Table ID", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - } - ], - "responses": { - "200": { - "description": "Column created", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Column" - } - } - } - }, - "403": { - "description": "No permissions", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - }, - "500": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - } - }, - "/index.php/apps/tables/api/1/views/{viewId}/columns": { - "get": { - "operationId": "api1-list-view-columns", - "summary": "Get all columns for a view Return an empty array if no columns were found", - "tags": [ - "api1" - ], - "security": [ - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "viewId", - "in": "path", - "description": "View ID", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - } - ], - "responses": { - "200": { - "description": "View deleted", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Column" - } - } - } - } - }, - "403": { - "description": "No permissions", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - }, - "500": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - } - }, - "/index.php/apps/tables/api/1/columns": { - "post": { - "operationId": "api1-create-column", - "summary": "Create a column", - "tags": [ - "api1" - ], - "security": [ - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "tableId", - "in": "query", - "description": "Table ID", - "schema": { - "type": "integer", - "format": "int64", - "nullable": true - } - }, - { - "name": "viewId", - "in": "query", - "description": "View ID", - "schema": { - "type": "integer", - "format": "int64", - "nullable": true - } - }, - { - "name": "title", - "in": "query", - "description": "Title", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "type", - "in": "query", - "description": "Column main type", - "required": true, - "schema": { - "type": "string", - "enum": [ - "text", - "number", - "datetime", - "select" - ] - } - }, - { - "name": "subtype", - "in": "query", - "description": "Column sub type", - "schema": { - "type": "string", - "nullable": true - } - }, - { - "name": "mandatory", - "in": "query", - "description": "Is the column mandatory", - "required": true, - "schema": { - "type": "integer", - "enum": [ - 0, - 1 - ] - } - }, - { - "name": "description", - "in": "query", - "description": "Description", - "schema": { - "type": "string", - "nullable": true - } - }, - { - "name": "numberPrefix", - "in": "query", - "description": "Prefix if the column is a number field", - "schema": { - "type": "string", - "nullable": true - } - }, - { - "name": "numberSuffix", - "in": "query", - "description": "Suffix if the column is a number field", - "schema": { - "type": "string", - "nullable": true - } - }, - { - "name": "numberDefault", - "in": "query", - "description": "Default number, if column is a number", - "schema": { - "type": "number", - "format": "float", - "nullable": true - } - }, - { - "name": "numberMin", - "in": "query", - "description": "Min value, if column is a number", - "schema": { - "type": "number", - "format": "float", - "nullable": true - } - }, - { - "name": "numberMax", - "in": "query", - "description": "Max number, if column is a number", - "schema": { - "type": "number", - "format": "float", - "nullable": true - } - }, - { - "name": "numberDecimals", - "in": "query", - "description": "Number of decimals, if column is a number", - "schema": { - "type": "integer", - "format": "int64", - "nullable": true - } - }, - { - "name": "textDefault", - "in": "query", - "description": "Default text, if column is a text", - "schema": { - "type": "string", - "nullable": true - } - }, - { - "name": "textAllowedPattern", - "in": "query", - "description": "Allowed pattern (regex) for text columns (not yet implemented)", - "schema": { - "type": "string", - "nullable": true - } - }, - { - "name": "textMaxLength", - "in": "query", - "description": "Max length, if column is a text", - "schema": { - "type": "integer", - "format": "int64", - "nullable": true - } - }, - { - "name": "selectionOptions", - "in": "query", - "description": "Options for a selection (json array{id: int, label: string})", - "schema": { - "type": "string", - "nullable": true, - "default": "" - } - }, - { - "name": "selectionDefault", - "in": "query", - "description": "Default option IDs for a selection (json int[])", - "schema": { - "type": "string", - "nullable": true, - "default": "" - } - }, - { - "name": "datetimeDefault", - "in": "query", - "description": "Default value, if column is datetime", - "schema": { - "type": "string", - "nullable": true, - "default": "" - } - }, - { - "name": "selectedViewIds[]", - "in": "query", - "description": "View IDs where this column should be added to be presented", - "schema": { - "type": "array", - "nullable": true, - "default": [], - "items": { - "type": "integer", - "format": "int64" - } - } - } - ], - "responses": { - "200": { - "description": "Column created", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Column" - } - } - } - }, - "403": { - "description": "No permissions", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - }, - "500": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - } - }, - "/index.php/apps/tables/api/1/columns/{columnId}": { - "put": { - "operationId": "api1-update-column", - "summary": "Update a column", - "tags": [ - "api1" - ], - "security": [ - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "title", - "in": "query", - "description": "Title", - "schema": { - "type": "string", - "nullable": true - } - }, - { - "name": "subtype", - "in": "query", - "description": "Column sub type", - "schema": { - "type": "string", - "nullable": true - } - }, - { - "name": "mandatory", - "in": "query", - "description": "Is the column mandatory", - "required": true, - "schema": { - "type": "integer", - "enum": [ - 0, - 1 - ] - } - }, - { - "name": "description", - "in": "query", - "description": "Description", - "schema": { - "type": "string", - "nullable": true - } - }, - { - "name": "numberPrefix", - "in": "query", - "description": "Prefix if the column is a number field", - "schema": { - "type": "string", - "nullable": true - } - }, - { - "name": "numberSuffix", - "in": "query", - "description": "Suffix if the column is a number field", - "schema": { - "type": "string", - "nullable": true - } - }, - { - "name": "numberDefault", - "in": "query", - "description": "Default number, if column is a number", - "schema": { - "type": "number", - "format": "float", - "nullable": true - } - }, - { - "name": "numberMin", - "in": "query", - "description": "Min value, if column is a number", - "schema": { - "type": "number", - "format": "float", - "nullable": true - } - }, - { - "name": "numberMax", - "in": "query", - "description": "Max number, if column is a number", - "schema": { - "type": "number", - "format": "float", - "nullable": true - } - }, - { - "name": "numberDecimals", - "in": "query", - "description": "Number of decimals, if column is a number", - "schema": { - "type": "integer", - "format": "int64", - "nullable": true - } - }, - { - "name": "textDefault", - "in": "query", - "description": "Default text, if column is a text", - "schema": { - "type": "string", - "nullable": true - } - }, - { - "name": "textAllowedPattern", - "in": "query", - "description": "Allowed pattern (regex) for text columns (not yet implemented)", - "schema": { - "type": "string", - "nullable": true - } - }, - { - "name": "textMaxLength", - "in": "query", - "description": "Max length, if column is a text", - "schema": { - "type": "integer", - "format": "int64", - "nullable": true - } - }, - { - "name": "selectionOptions", - "in": "query", - "description": "Options for a selection (json array{id: int, label: string})", - "schema": { - "type": "string", - "nullable": true - } - }, - { - "name": "selectionDefault", - "in": "query", - "description": "Default option IDs for a selection (json int[])", - "schema": { - "type": "string", - "nullable": true - } - }, - { - "name": "datetimeDefault", - "in": "query", - "description": "Default value, if column is datetime", - "schema": { - "type": "string", - "nullable": true - } - }, - { - "name": "columnId", - "in": "path", - "description": "Column ID that will be updated", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - } - ], - "responses": { - "200": { - "description": "Updated column", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Column" - } - } - } - }, - "500": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - }, - "get": { - "operationId": "api1-get-column", - "summary": "Returns a column object", - "tags": [ - "api1" - ], - "security": [ - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "columnId", - "in": "path", - "description": "Wanted Column ID", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - } - ], - "responses": { - "200": { - "description": "Column returned", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Column" - } - } - } - }, - "403": { - "description": "No permissions", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - }, - "500": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - }, - "delete": { - "operationId": "api1-delete-column", - "summary": "Delete a column", - "tags": [ - "api1" - ], - "security": [ - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "columnId", - "in": "path", - "description": "Wanted Column ID", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - } - ], - "responses": { - "200": { - "description": "Deleted column returned", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Column" - } - } - } - }, - "403": { - "description": "No permissions", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - }, - "500": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - } - }, - "/index.php/apps/tables/api/1/tables/{tableId}/rows/simple": { - "get": { - "operationId": "api1-list-table-rows-simple", - "summary": "List all rows values for a table, first row are the column titles", - "tags": [ - "api1" - ], - "security": [ - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "limit", - "in": "query", - "description": "Limit", - "schema": { - "type": "integer", - "format": "int64", - "nullable": true - } - }, - { - "name": "offset", - "in": "query", - "description": "Offset", - "schema": { - "type": "integer", - "format": "int64", - "nullable": true - } - }, - { - "name": "tableId", - "in": "path", - "description": "Table ID", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - } - ], - "responses": { - "200": { - "description": "Row values returned", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - }, - "403": { - "description": "No permissions", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - }, - "500": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - } - }, - "/index.php/apps/tables/api/1/tables/{tableId}/rows": { - "get": { - "operationId": "api1-list-table-rows", - "summary": "List all rows for a table", - "tags": [ - "api1" - ], - "security": [ - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "limit", - "in": "query", - "description": "Limit", - "schema": { - "type": "integer", - "format": "int64", - "nullable": true - } - }, - { - "name": "offset", - "in": "query", - "description": "Offset", - "schema": { - "type": "integer", - "format": "int64", - "nullable": true - } - }, - { - "name": "tableId", - "in": "path", - "description": "Table ID", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - } - ], - "responses": { - "200": { - "description": "Rows returned", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Row" - } - } - } - } - }, - "403": { - "description": "No permissions", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - }, - "500": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - }, - "post": { - "operationId": "api1-create-row-in-table", - "summary": "Create a row within a table", - "tags": [ - "api1" - ], - "security": [ - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "data", - "in": "query", - "description": "Data as key - value store", - "required": true, - "schema": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "object", - "required": [ - "columnId", - "value" - ], - "properties": { - "columnId": { - "type": "integer", - "format": "int64" - }, - "value": { - "type": "object" - } - } - } - ] - } - }, - { - "name": "tableId", - "in": "path", - "description": "Table ID", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - } - ], - "responses": { - "200": { - "description": "Row returned", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Row" - } - } - } - }, - "403": { - "description": "No permissions", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - }, - "500": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - } - }, - "/index.php/apps/tables/api/1/views/{viewId}/rows": { - "get": { - "operationId": "api1-list-view-rows", - "summary": "List all rows for a view", - "tags": [ - "api1" - ], - "security": [ - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "limit", - "in": "query", - "description": "Limit", - "schema": { - "type": "integer", - "format": "int64", - "nullable": true - } - }, - { - "name": "offset", - "in": "query", - "description": "Offset", - "schema": { - "type": "integer", - "format": "int64", - "nullable": true - } - }, - { - "name": "viewId", - "in": "path", - "description": "View ID", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - } - ], - "responses": { - "200": { - "description": "Rows returned", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Row" - } - } - } - } - }, - "403": { - "description": "No permissions", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - }, - "500": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - }, - "post": { - "operationId": "api1-create-row-in-view", - "summary": "Create a row within a view", - "tags": [ - "api1" - ], - "security": [ - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "data", - "in": "query", - "description": "Data as key - value store", - "required": true, - "schema": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "object", - "required": [ - "columnId", - "value" - ], - "properties": { - "columnId": { - "type": "integer", - "format": "int64" - }, - "value": { - "type": "object" - } - } - } - ] - } - }, - { - "name": "viewId", - "in": "path", - "description": "View ID", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - } - ], - "responses": { - "200": { - "description": "Row returned", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Row" - } - } - } - }, - "403": { - "description": "No permissions", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - }, - "500": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - } - }, - "/index.php/apps/tables/api/1/rows/{rowId}": { - "get": { - "operationId": "api1-get-row", - "summary": "Get a row", - "tags": [ - "api1" - ], - "security": [ - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "rowId", - "in": "path", - "description": "Row ID", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - } - ], - "responses": { - "200": { - "description": "Row returned", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Row" - } - } - } - }, - "403": { - "description": "No permissions", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - }, - "500": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - }, - "put": { - "operationId": "api1-update-row", - "summary": "Update a row", - "tags": [ - "api1" - ], - "security": [ - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "viewId", - "in": "query", - "description": "View ID", - "schema": { - "type": "integer", - "format": "int64", - "nullable": true - } - }, - { - "name": "data", - "in": "query", - "description": "Data as key - value store", - "required": true, - "schema": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "object", - "required": [ - "columnId", - "value" - ], - "properties": { - "columnId": { - "type": "integer", - "format": "int64" - }, - "value": { - "type": "object" - } - } - } - ] - } - }, - { - "name": "rowId", - "in": "path", - "description": "Row ID", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - } - ], - "responses": { - "200": { - "description": "Updated row returned", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Row" - } - } - } - }, - "403": { - "description": "No permissions", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - }, - "500": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - }, - "delete": { - "operationId": "api1-delete-row", - "summary": "Delete a row", - "tags": [ - "api1" - ], - "security": [ - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "rowId", - "in": "path", - "description": "Row ID", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - } - ], - "responses": { - "200": { - "description": "Deleted row returned", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Row" - } - } - } - }, - "403": { - "description": "No permissions", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - }, - "500": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - } - }, - "/index.php/apps/tables/api/1/views/{viewId}/rows/{rowId}": { - "delete": { - "operationId": "api1-delete-row-by-view", - "summary": "Delete a row within a view", - "tags": [ - "api1" - ], - "security": [ - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "viewId", - "in": "path", - "description": "View ID", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "rowId", - "in": "path", - "description": "Row ID", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - } - ], - "responses": { - "200": { - "description": "Deleted row returned", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Row" - } - } - } - }, - "403": { - "description": "No permissions", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - }, - "500": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - } - }, - "/index.php/apps/tables/api/1/import/table/{tableId}": { - "post": { - "operationId": "api1-import-in-table", - "summary": "Import from file in to a table", - "tags": [ - "api1" - ], - "security": [ - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "path", - "in": "query", - "description": "Path to file", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "createMissingColumns", - "in": "query", - "description": "Create missing columns", - "schema": { - "type": "integer", - "default": 1, - "enum": [ - 0, - 1 - ] - } - }, - { - "name": "tableId", - "in": "path", - "description": "Table ID", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - } - ], - "responses": { - "200": { - "description": "Import status returned", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ImportState" - } - } - } - }, - "403": { - "description": "No permissions", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - }, - "500": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - } - }, - "/index.php/apps/tables/api/1/import/views/{viewId}": { - "post": { - "operationId": "api1-import-in-view", - "summary": "Import from file in to a table", - "tags": [ - "api1" - ], - "security": [ - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "path", - "in": "query", - "description": "Path to file", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "createMissingColumns", - "in": "query", - "description": "Create missing columns", - "schema": { - "type": "integer", - "default": 1, - "enum": [ - 0, - 1 - ] - } - }, - { - "name": "viewId", - "in": "path", - "description": "View ID", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - } - ], - "responses": { - "200": { - "description": "Import status returned", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ImportState" - } - } - } - }, - "403": { - "description": "No permissions", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - }, - "500": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - }, - "404": { - "description": "Not found", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - } - } - } - } - } - } - }, - "/ocs/v2.php/apps/tables/api/2/init": { - "get": { - "operationId": "api_general-list", - "summary": "[api v2] Returns all main resources", - "description": "Tables and views incl. shares", - "tags": [ - "api_general" - ], - "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": "Index returned", - "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/Index" - } - } - } - } - } - } - } - }, - "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" - } - } - } - } - } - } - } - } - } - } - } - } - }, - "/ocs/v2.php/apps/tables/api/2/tables": { - "get": { - "operationId": "api_tables-list", - "summary": "[api v2] Returns all Tables", - "tags": [ - "api_tables" - ], - "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": "Tables 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/Table" - } - } - } - } - } - } - } - } - }, - "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" - } - } - } - } - } - } - } - } - } - } - } - }, - "post": { - "operationId": "api_tables-create", - "summary": "[api v2] Create a new table and return it", - "tags": [ - "api_tables" - ], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "title", - "in": "query", - "description": "Title of the table", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "emoji", - "in": "query", - "description": "Emoji for the table", - "schema": { - "type": "string", - "nullable": true - } - }, - { - "name": "template", - "in": "query", - "description": "Template to use if wanted", - "schema": { - "type": "string", - "default": "custom" - } - }, - { - "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": "Tables returned", - "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/Table" - } - } - } - } - } - } - } - }, - "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" - } - } - } - } - } - } - } - } - } - } - } - } - }, - "/ocs/v2.php/apps/tables/api/2/tables/{id}": { - "get": { - "operationId": "api_tables-show", - "summary": "[api v2] Get a table object", - "tags": [ - "api_tables" - ], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "id", - "in": "path", - "description": "Table ID", - "required": true, - "schema": { - "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": "Table returned", - "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/Table" - } - } - } - } - } - } - } - }, - "403": { - "description": "No permissions", - "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" - } - } - } - } - } - } - } - } - } - }, - "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" - } - } - } - } - } - } - } - } - } - }, - "404": { - "description": "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" - } - } - } - } - } - } - } - } - } - } - } - }, - "put": { - "operationId": "api_tables-update", - "summary": "[api v2] Update tables properties", - "tags": [ - "api_tables" - ], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "title", - "in": "query", - "description": "New table title", - "schema": { - "type": "string", - "nullable": true - } - }, - { - "name": "emoji", - "in": "query", - "description": "New table emoji", - "schema": { - "type": "string", - "nullable": true - } - }, - { - "name": "id", - "in": "path", - "description": "Table ID", - "required": true, - "schema": { - "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": "Tables returned", - "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/Table" - } - } - } - } - } - } - } - }, - "403": { - "description": "No permissions", - "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" - } - } - } - } - } - } - } - } - } - }, - "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" - } - } - } - } - } - } - } - } - } - }, - "404": { - "description": "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" - } - } - } - } - } - } - } - } - } - } - } - }, - "delete": { - "operationId": "api_tables-destroy", - "summary": "[api v2] Delete a table", - "tags": [ - "api_tables" - ], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "id", - "in": "path", - "description": "Table ID", - "required": true, - "schema": { - "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": "Deleted table returned", - "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/Table" - } - } - } - } - } - } - } - }, - "403": { - "description": "No permissions", - "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" - } - } - } - } - } - } - } - } - } - }, - "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" - } - } - } - } - } - } - } - } - } - }, - "404": { - "description": "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" - } - } - } - } - } - } - } - } - } - } - } - } - }, - "/ocs/v2.php/apps/tables/api/2/tables/{id}/transfer": { - "put": { - "operationId": "api_tables-transfer", - "summary": "[api v2] Transfer table", - "description": "Transfer table from one user to another", - "tags": [ - "api_tables" - ], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "newOwnerUserId", - "in": "query", - "description": "New user ID", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "id", - "in": "path", - "description": "Table ID", - "required": true, - "schema": { - "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": "Ownership changed", - "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/Table" - } - } - } - } - } - } - } - }, - "403": { - "description": "No permissions", - "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" - } - } - } - } - } - } - } - } - } - }, - "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" - } - } - } - } - } - } - } - } - } - }, - "404": { - "description": "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" - } - } - } - } - } - } - } - } - } - } - } - } - }, - "/ocs/v2.php/apps/tables/api/2/columns/{nodeType}/{nodeId}": { - "get": { - "operationId": "api_columns-list", - "summary": "[api v2] Get all columns for a table or a view", - "description": "Return an empty array if no columns were found", - "tags": [ - "api_columns" - ], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "nodeType", - "in": "path", - "description": "Node type", - "required": true, - "schema": { - "type": "string", - "enum": [ - "table", - "view" - ] - } - }, - { - "name": "nodeId", - "in": "path", - "description": "Node ID", - "required": true, - "schema": { - "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": "View deleted", - "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/Column" - } - } - } - } - } - } - } - } - }, - "403": { - "description": "No permissions", - "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" - } - } - } - } - } - } - } - } - } - }, - "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" - } - } - } - } - } - } - } - } - } - }, - "404": { - "description": "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" - } - } - } - } - } - } - } - } - } - } - } - } - }, - "/ocs/v2.php/apps/tables/api/2/columns/{id}": { - "get": { - "operationId": "api_columns-show", - "summary": "[api v2] Get a column object", - "tags": [ - "api_columns" - ], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "id", - "in": "path", - "description": "Column ID", - "required": true, - "schema": { - "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": "Column returned", - "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/Column" - } - } - } - } - } - } - } - }, - "403": { - "description": "No permissions", - "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" - } - } - } - } - } - } - } - } - } - }, - "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" - } - } - } - } - } - } - } - } - } - }, - "404": { - "description": "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" - } - } - } - } - } - } - } - } - } - } - } - } - }, - "/ocs/v2.php/apps/tables/api/2/columns/number": { - "post": { - "operationId": "api_columns-create-number-column", - "summary": "[api v2] Create new numbered column", - "description": "Specify a subtype to use any special numbered column", - "tags": [ - "api_columns" - ], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "baseNodeId", - "in": "query", - "description": "Context of the column creation", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "title", - "in": "query", - "description": "Title", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "numberDefault", - "in": "query", - "description": "Default value for new rows", - "schema": { - "type": "number", - "format": "float", - "nullable": true - } - }, - { - "name": "numberDecimals", - "in": "query", - "description": "Decimals", - "schema": { - "type": "integer", - "format": "int64", - "nullable": true - } - }, - { - "name": "numberPrefix", - "in": "query", - "description": "Prefix", - "schema": { - "type": "string", - "nullable": true - } - }, - { - "name": "numberSuffix", - "in": "query", - "description": "Suffix", - "schema": { - "type": "string", - "nullable": true - } - }, - { - "name": "numberMin", - "in": "query", - "description": "Min", - "schema": { - "type": "number", - "format": "float", - "nullable": true - } - }, - { - "name": "numberMax", - "in": "query", - "description": "Max", - "schema": { - "type": "number", - "format": "float", - "nullable": true - } - }, - { - "name": "subtype", - "in": "query", - "description": "Subtype for the new column", - "schema": { - "type": "string", - "nullable": true, - "enum": [ - "progress", - "stars" - ] - } - }, - { - "name": "description", - "in": "query", - "description": "Description", - "schema": { - "type": "string", - "nullable": true - } - }, - { - "name": "selectedViewIds[]", - "in": "query", - "description": "View IDs where this columns should be added", - "schema": { - "type": "array", - "nullable": true, - "default": [], - "items": { - "type": "integer", - "format": "int64" - } - } - }, - { - "name": "mandatory", - "in": "query", - "description": "Is mandatory", - "schema": { - "type": "integer", - "default": 0, - "enum": [ - 0, - 1 - ] - } - }, - { - "name": "baseNodeType", - "in": "query", - "description": "Context type of the column creation", - "schema": { - "type": "string", - "default": "table", - "enum": [ - "table", - "view" - ] - } - }, - { - "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": "Column created", - "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/Column" - } - } - } - } - } - } - } - }, - "403": { - "description": "No permission", - "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" - } - } - } - } - } - } - } - } - } - }, - "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" - } - } - } - } - } - } - } - }, - "text/plain": { - "schema": { - "type": "string" - } - } - } - }, - "404": { - "description": "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" - } - } - } - } - } - } - } - } - } - } - } - } - }, - "/ocs/v2.php/apps/tables/api/2/columns/text": { - "post": { - "operationId": "api_columns-create-text-column", - "summary": "[api v2] Create new text column", - "description": "Specify a subtype to use any special text column", - "tags": [ - "api_columns" - ], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "baseNodeId", - "in": "query", - "description": "Context of the column creation", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "title", - "in": "query", - "description": "Title", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "textDefault", - "in": "query", - "description": "Default", - "schema": { - "type": "string", - "nullable": true - } - }, - { - "name": "textAllowedPattern", - "in": "query", - "description": "Allowed regex pattern", - "schema": { - "type": "string", - "nullable": true - } - }, - { - "name": "textMaxLength", - "in": "query", - "description": "Max raw text length", - "schema": { - "type": "integer", - "format": "int64", - "nullable": true - } - }, - { - "name": "subtype", - "in": "query", - "description": "Subtype for the new column", - "schema": { - "type": "string", - "nullable": true, - "enum": [ - "progress", - "stars" - ] - } - }, - { - "name": "description", - "in": "query", - "description": "Description", - "schema": { - "type": "string", - "nullable": true - } - }, - { - "name": "selectedViewIds[]", - "in": "query", - "description": "View IDs where this columns should be added", - "schema": { - "type": "array", - "nullable": true, - "default": [], - "items": { - "type": "integer", - "format": "int64" - } - } - }, - { - "name": "mandatory", - "in": "query", - "description": "Is mandatory", - "schema": { - "type": "integer", - "default": 0, - "enum": [ - 0, - 1 - ] - } - }, - { - "name": "baseNodeType", - "in": "query", - "description": "Context type of the column creation", - "schema": { - "type": "string", - "default": "table", - "enum": [ - "table", - "view" - ] - } - }, - { - "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": "Column created", - "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/Column" - } - } - } - } - } - } - } - }, - "403": { - "description": "No permission", - "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" - } - } - } - } - } - } - } - } - } - }, - "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" - } - } - } - } - } - } - } - }, - "text/plain": { - "schema": { - "type": "string" - } - } - } - }, - "404": { - "description": "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" - } - } - } - } - } - } - } - } - } - } - } - } - }, - "/ocs/v2.php/apps/tables/api/2/columns/selection": { - "post": { - "operationId": "api_columns-create-selection-column", - "summary": "[api v2] Create new selection column", - "description": "Specify a subtype to use any special selection column", - "tags": [ - "api_columns" - ], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "baseNodeId", - "in": "query", - "description": "Context of the column creation", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "title", - "in": "query", - "description": "Title", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "selectionOptions", - "in": "query", - "description": "Json array{id: int, label: string} with options that can be selected, eg [{\"id\": 1, \"label\": \"first\"},{\"id\": 2, \"label\": \"second\"}]", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "selectionDefault", - "in": "query", - "description": "Json int|int[] for default selected option(s), eg 5 or [\"1\", \"8\"]", - "schema": { - "type": "string", - "nullable": true - } - }, - { - "name": "subtype", - "in": "query", - "description": "Subtype for the new column", - "schema": { - "type": "string", - "nullable": true, - "enum": [ - "progress", - "stars" - ] - } - }, - { - "name": "description", - "in": "query", - "description": "Description", - "schema": { - "type": "string", - "nullable": true - } - }, - { - "name": "selectedViewIds[]", - "in": "query", - "description": "View IDs where this columns should be added", - "schema": { - "type": "array", - "nullable": true, - "default": [], - "items": { - "type": "integer", - "format": "int64" - } - } - }, - { - "name": "mandatory", - "in": "query", - "description": "Is mandatory", - "schema": { - "type": "integer", - "default": 0, - "enum": [ - 0, - 1 - ] - } - }, - { - "name": "baseNodeType", - "in": "query", - "description": "Context type of the column creation", - "schema": { - "type": "string", - "default": "table", - "enum": [ - "table", - "view" - ] - } - }, - { - "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": "Column created", - "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/Column" - } - } - } - } - } - } - } - }, - "403": { - "description": "No permission", - "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" - } - } - } - } - } - } - } - } - } - }, - "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" - } - } - } - } - } - } - } - }, - "text/plain": { - "schema": { - "type": "string" - } - } - } - }, - "404": { - "description": "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" - } - } - } - } - } - } - } - } - } - } - } - } - }, - "/ocs/v2.php/apps/tables/api/2/columns/datetime": { - "post": { - "operationId": "api_columns-create-datetime-column", - "summary": "[api v2] Create new datetime column", - "description": "Specify a subtype to use any special datetime column", - "tags": [ - "api_columns" - ], - "security": [ - { - "bearer_auth": [] - }, - { - "basic_auth": [] - } - ], - "parameters": [ - { - "name": "baseNodeId", - "in": "query", - "description": "Context of the column creation", - "required": true, - "schema": { - "type": "integer", - "format": "int64" - } - }, - { - "name": "title", - "in": "query", - "description": "Title", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "datetimeDefault", - "in": "query", - "description": "For a subtype 'date' you can set 'today'. For a main type or subtype 'time' you can set to 'now'.", - "schema": { - "type": "string", - "nullable": true, - "enum": [ - "today", - "now" - ] - } - }, - { - "name": "subtype", - "in": "query", - "description": "Subtype for the new column", - "schema": { - "type": "string", - "nullable": true, - "enum": [ - "progress", - "stars" - ] - } - }, - { - "name": "description", - "in": "query", - "description": "Description", - "schema": { - "type": "string", - "nullable": true - } - }, - { - "name": "selectedViewIds[]", - "in": "query", - "description": "View IDs where this columns should be added", - "schema": { - "type": "array", - "nullable": true, - "default": [], - "items": { - "type": "integer", - "format": "int64" - } - } - }, - { - "name": "mandatory", - "in": "query", - "description": "Is mandatory", - "schema": { - "type": "integer", - "default": 0, - "enum": [ - 0, - 1 - ] - } - }, - { - "name": "baseNodeType", - "in": "query", - "description": "Context type of the column creation", - "schema": { - "type": "string", - "default": "table", - "enum": [ - "table", - "view" - ] - } - }, - { - "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": "Column created", - "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/Column" - } - } - } - } - } - } - } - }, - "403": { - "description": "No permission", - "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" - } - } - } - } - } - } - } - } - } - }, - "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" - } - } - } - } - } - } - } - }, - "text/plain": { - "schema": { - "type": "string" - } - } - } - }, - "404": { - "description": "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" - } - } - } - } - } - } - } - } - } - } - } - } - }, - "/ocs/v2.php/apps/tables/api/3/contexts": { - "get": { - "operationId": "contexts-list", - "summary": "[api v3] Get all contexts available to the requesting person", - "description": "Return an empty array if no contexts were found", - "tags": [ - "contexts" - ], - "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": "reporting in available contexts", - "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/Context" - } - } - } - } - } - } - } - } - }, - "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" - } - } - } - } - } - } - } - } - } - } - } - } - } - }, - "tags": [] -} \ No newline at end of file