fix various errors, add missing functions

This commit is contained in:
Uwe Steinmann 2022-11-07 12:20:50 +01:00
parent 6f4ec80ad6
commit fa56d5735d

View File

@ -13,6 +13,9 @@ info:
license: license:
name: "Apache 2.0" name: "Apache 2.0"
url: "http://www.apache.org/licenses/LICENSE-2.0.html" url: "http://www.apache.org/licenses/LICENSE-2.0.html"
servers:
- url:
description: Current host server
host: "<?php echo $_SERVER['HTTP_HOST']; ?>" host: "<?php echo $_SERVER['HTTP_HOST']; ?>"
basePath: "<?php echo $settings->_httpRoot; ?>restapi/index.php" basePath: "<?php echo $settings->_httpRoot; ?>restapi/index.php"
tags: tags:
@ -22,6 +25,7 @@ tags:
description: "Find out more about our store" description: "Find out more about our store"
url: "https://www.seeddms.org" url: "https://www.seeddms.org"
schemes: schemes:
- "http"
- "https" - "https"
paths: paths:
/login: /login:
@ -32,9 +36,9 @@ paths:
description: "Log in by providing a username and password" description: "Log in by providing a username and password"
operationId: "login" operationId: "login"
produces: produces:
- "application/json" - "application/json"
consumes: consumes:
- application/x-www-form-urlencoded - "application/x-www-form-urlencoded"
parameters: parameters:
- name: "user" - name: "user"
in: "formData" in: "formData"
@ -111,7 +115,7 @@ paths:
produces: produces:
- "application/json" - "application/json"
consumes: consumes:
- application/x-www-form-urlencoded - "application/x-www-form-urlencoded"
parameters: parameters:
- in: formData - in: formData
name: email name: email
@ -138,7 +142,7 @@ paths:
produces: produces:
- "application/json" - "application/json"
consumes: consumes:
- multipart/form-data - "application/x-www-form-urlencoded"
parameters: parameters:
- in: formData - in: formData
name: email name: email
@ -208,7 +212,7 @@ paths:
produces: produces:
- "application/json" - "application/json"
consumes: consumes:
- multipart/form-data - "application/x-www-form-urlencoded"
parameters: parameters:
- in: "formData" - in: "formData"
name: "user" name: "user"
@ -371,7 +375,7 @@ paths:
produces: produces:
- "application/json" - "application/json"
consumes: consumes:
- multipart/form-data - "application/x-www-form-urlencoded"
parameters: parameters:
- name: "id" - name: "id"
in: "path" in: "path"
@ -431,7 +435,7 @@ paths:
produces: produces:
- "application/json" - "application/json"
consumes: consumes:
- multipart/form-data - "application/x-www-form-urlencoded"
parameters: parameters:
- in: "formData" - in: "formData"
name: "name" name: "name"
@ -687,11 +691,106 @@ paths:
$ref: "#/definitions/ApiResponse" $ref: "#/definitions/ApiResponse"
security: security:
- api_key: [] - api_key: []
/document/{id}/version/{version}/attributes:
get:
tags:
- "document"
summary: "Return attributes of document version"
description: "Returns the attributes of a given document version"
operationId: "getDocumentContentAttributes"
produces:
- "application/json"
parameters:
- name: "id"
in: "path"
description: "ID of document whose attributes to be returned."
type: "integer"
required: true
format: "int64"
- name: "version"
in: "path"
description: "Version number of document"
required: true
type: "integer"
format: "int64"
responses:
"200":
description: "successful operation"
schema:
$ref: "#/definitions/ApiResponseAttributes"
"403":
description: "No access"
schema:
$ref: "#/definitions/ApiResponse"
"404":
description: "Document or version not found"
schema:
$ref: "#/definitions/ApiResponse"
"500":
description: "Internal error"
schema:
$ref: "#/definitions/ApiResponse"
security:
- api_key: []
/document/{id}/version/{version}/attribute/{attrdefid}:
put:
tags:
- "document"
summary: "Set document version attribute"
description: "Sets the attribute value of a document version. If the value is an empty string the attribute will be deleted."
operationId: "setDocumentContentAttribute"
produces:
- "application/json"
consumes:
- "application/x-www-form-urlencoded"
parameters:
- name: "id"
in: "path"
description: "ID of document"
required: true
type: "integer"
format: "int64"
- name: "version"
in: "path"
description: "Version number of document"
required: true
type: "integer"
format: "int64"
- name: "attrdefid"
in: "path"
description: "ID of attribute definition"
required: true
type: "integer"
format: "int64"
- in: "formData"
name: "value"
type: "string"
description: "Value of attribute"
required: true
responses:
"201":
description: "successful operation"
schema:
$ref: "#/definitions/ApiResponse"
"400":
description: "Invalid attribute value, or setting an attribute not allowed for the type of object"
schema:
$ref: "#/definitions/ApiResponse"
"403":
description: "No access"
schema:
$ref: "#/definitions/ApiResponse"
"404":
description: "Document, version or attribute definition not found"
schema:
$ref: "#/definitions/ApiResponse"
security:
- api_key: []
/document/{id}/attributes: /document/{id}/attributes:
get: get:
tags: tags:
- "document" - "document"
summary: "Return attributes of document by ID" summary: "Return attributes of document"
description: "Returns the attributes of a given document" description: "Returns the attributes of a given document"
operationId: "getDocumentAttributes" operationId: "getDocumentAttributes"
produces: produces:
@ -722,11 +821,59 @@ paths:
$ref: "#/definitions/ApiResponse" $ref: "#/definitions/ApiResponse"
security: security:
- api_key: [] - api_key: []
/document/{id}/attribute/{attrdefid}:
put:
tags:
- "document"
summary: "Set document attribute"
description: "Sets the attribute value of a document. If the value is an empty string the attribute will be deleted."
operationId: "setDocumentAttribute"
produces:
- "application/json"
consumes:
- "application/x-www-form-urlencoded"
parameters:
- name: "id"
in: "path"
description: "ID of document"
required: true
type: "integer"
format: "int64"
- name: "attrdefid"
in: "path"
description: "ID of attribute definition"
required: true
type: "integer"
format: "int64"
- in: "formData"
name: "value"
type: "string"
description: "Value of attribute"
required: true
responses:
"201":
description: "successful operation"
schema:
$ref: "#/definitions/ApiResponse"
"400":
description: "Invalid attribute value, or setting an attribute not allowed for the type of object"
schema:
$ref: "#/definitions/ApiResponse"
"403":
description: "No access"
schema:
$ref: "#/definitions/ApiResponse"
"404":
description: "Document or attribute definition not found"
schema:
$ref: "#/definitions/ApiResponse"
security:
- api_key: []
/document/{id}/files: /document/{id}/files:
get: get:
tags: tags:
- "document" - "document"
summary: "Return attached files of document by ID" summary: "Return attached files of document"
description: "Returns the attached files of a given document" description: "Returns the attached files of a given document"
operationId: "getDocumentFiles" operationId: "getDocumentFiles"
produces: produces:
@ -802,7 +949,7 @@ paths:
produces: produces:
- "application/json" - "application/json"
consumes: consumes:
- multipart/form-data - "application/x-www-form-urlencoded"
parameters: parameters:
- name: "id" - name: "id"
in: "path" in: "path"
@ -920,7 +1067,7 @@ paths:
produces: produces:
- "application/json" - "application/json"
consumes: consumes:
- multipart/form-data - "application/x-www-form-urlencoded"
parameters: parameters:
- name: "id" - name: "id"
in: "path" in: "path"
@ -957,7 +1104,6 @@ paths:
$ref: "#/definitions/ApiResponse" $ref: "#/definitions/ApiResponse"
security: security:
- api_key: [] - api_key: []
/document/{id}/category/{catid}:
delete: delete:
tags: tags:
- "document" - "document"
@ -1008,7 +1154,7 @@ paths:
produces: produces:
- "application/json" - "application/json"
consumes: consumes:
- multipart/form-data - "application/x-www-form-urlencoded"
parameters: parameters:
- name: "id" - name: "id"
in: "path" in: "path"
@ -1223,7 +1369,7 @@ paths:
get: get:
tags: tags:
- "folder" - "folder"
summary: "Return attributes of folder by ID" summary: "Return attributes of folder"
description: "Returns the attributes of a given folder" description: "Returns the attributes of a given folder"
operationId: "getFolderAttributes" operationId: "getFolderAttributes"
produces: produces:
@ -1254,6 +1400,54 @@ paths:
$ref: "#/definitions/ApiResponse" $ref: "#/definitions/ApiResponse"
security: security:
- api_key: [] - api_key: []
/folder/{id}/attribute/{attrdefid}:
put:
tags:
- "folder"
summary: "Set folder attribute"
description: "Sets the attribute value of a folder. If the value is an empty string the attribute will be deleted."
operationId: "setFolderAttribute"
produces:
- "application/json"
consumes:
- "application/x-www-form-urlencoded"
parameters:
- name: "id"
in: "path"
description: "ID of folder"
required: true
type: "integer"
format: "int64"
- name: "attrdefid"
in: "path"
description: "ID of attribute definition"
required: true
type: "integer"
format: "int64"
- in: "formData"
name: "value"
type: "string"
description: "Value of attribute"
required: true
responses:
"201":
description: "successful operation"
schema:
$ref: "#/definitions/ApiResponse"
"400":
description: "Invalid attribute value, or setting an attribute not allowed for the type of object"
schema:
$ref: "#/definitions/ApiResponse"
"403":
description: "No access"
schema:
$ref: "#/definitions/ApiResponse"
"404":
description: "Folder or attribute definition not found"
schema:
$ref: "#/definitions/ApiResponse"
security:
- api_key: []
/folder/{id}/folder: /folder/{id}/folder:
post: post:
tags: tags:
@ -1264,7 +1458,7 @@ paths:
produces: produces:
- "application/json" - "application/json"
consumes: consumes:
- multipart/form-data - "application/x-www-form-urlencoded"
parameters: parameters:
- name: "id" - name: "id"
in: "path" in: "path"
@ -1316,7 +1510,7 @@ paths:
produces: produces:
- "application/json" - "application/json"
consumes: consumes:
- multipart/form-data - "application/x-www-form-urlencoded"
parameters: parameters:
- name: "id" - name: "id"
in: "path" in: "path"
@ -1390,7 +1584,7 @@ paths:
produces: produces:
- "application/json" - "application/json"
consumes: consumes:
- multipart/form-data - "application/x-www-form-urlencoded"
parameters: parameters:
- in: "formData" - in: "formData"
name: "name" name: "name"
@ -1487,7 +1681,7 @@ paths:
produces: produces:
- "application/json" - "application/json"
consumes: consumes:
- multipart/form-data - "application/x-www-form-urlencoded"
parameters: parameters:
- name: "id" - name: "id"
in: "path" in: "path"
@ -1543,7 +1737,7 @@ paths:
produces: produces:
- "application/json" - "application/json"
consumes: consumes:
- multipart/form-data - "application/x-www-form-urlencoded"
parameters: parameters:
- name: "id" - name: "id"
in: "path" in: "path"
@ -1570,10 +1764,28 @@ paths:
$ref: "#/definitions/ApiResponse" $ref: "#/definitions/ApiResponse"
security: security:
- api_key: [] - api_key: []
/statstotal:
get:
tags:
- "misc"
summary: "Return various statistical data"
description: "Just returns the body content"
operationId: "getStatsTotal"
produces:
- "application/json"
responses:
"200":
description: "successful operation"
schema:
$ref: "#/definitions/ApiResponse"
"400":
description: "Invalid status value"
security:
- api_key: []
/echo: /echo:
get: get:
tags: tags:
- "test" - "misc"
summary: "Return what was send in the body" summary: "Return what was send in the body"
description: "Just returns the body content" description: "Just returns the body content"
operationId: "echoData" operationId: "echoData"