You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
624 lines
14 KiB
624 lines
14 KiB
{ |
|
"openapi": "3.1.0", |
|
"info": { |
|
"title": "User status", |
|
"version": "1.6.0", |
|
"description": "User status", |
|
"license": { |
|
"name": "agpl", |
|
"identifier": "AGPL-3.0" |
|
} |
|
}, |
|
"servers": [ |
|
{ |
|
"url": "https://{hostname}:{port}", |
|
"variables": { |
|
"hostname": { |
|
"default": "localhost" |
|
}, |
|
"port": { |
|
"default": "8080" |
|
} |
|
} |
|
} |
|
], |
|
"security": [ |
|
{ |
|
"basic_auth": [] |
|
} |
|
], |
|
"tags": [], |
|
"components": { |
|
"schemas": { |
|
"OCSMeta": { |
|
"type": "object", |
|
"required": [ |
|
"status", |
|
"statuscode" |
|
], |
|
"properties": { |
|
"status": { |
|
"type": "string" |
|
}, |
|
"statuscode": { |
|
"type": "integer" |
|
}, |
|
"message": { |
|
"type": "string" |
|
}, |
|
"totalitems": { |
|
"type": "string" |
|
}, |
|
"itemsperpage": { |
|
"type": "string" |
|
} |
|
} |
|
}, |
|
"EmptyOCS": { |
|
"type": "object", |
|
"required": [ |
|
"ocs" |
|
], |
|
"properties": { |
|
"ocs": { |
|
"type": "object", |
|
"required": [ |
|
"meta", |
|
"data" |
|
], |
|
"properties": { |
|
"meta": { |
|
"$ref": "#/components/schemas/OCSMeta" |
|
}, |
|
"data": { |
|
"type": "array" |
|
} |
|
} |
|
} |
|
} |
|
}, |
|
"PredefinedStatuses": { |
|
"type": "object", |
|
"required": [ |
|
"ocs" |
|
], |
|
"properties": { |
|
"ocs": { |
|
"type": "object", |
|
"required": [ |
|
"meta", |
|
"data" |
|
], |
|
"properties": { |
|
"meta": { |
|
"$ref": "#/components/schemas/OCSMeta" |
|
}, |
|
"data": { |
|
"type": "array", |
|
"items": { |
|
"$ref": "#/components/schemas/PredefinedStatus" |
|
} |
|
} |
|
} |
|
} |
|
} |
|
}, |
|
"PredefinedStatus": { |
|
"type": "object", |
|
"required": [ |
|
"id", |
|
"icon", |
|
"message" |
|
], |
|
"properties": { |
|
"id": { |
|
"type": "string" |
|
}, |
|
"icon": { |
|
"type": "string" |
|
}, |
|
"message": { |
|
"type": "string" |
|
}, |
|
"clearAt": { |
|
"oneOf": [ |
|
{ |
|
"$ref": "#/components/schemas/ClearAt" |
|
}, |
|
{ |
|
"type": "integer", |
|
"description": "Time as unix timestamp" |
|
} |
|
] |
|
} |
|
} |
|
}, |
|
"ClearAt": { |
|
"type": "object", |
|
"required": [ |
|
"type", |
|
"time" |
|
], |
|
"properties": { |
|
"type": { |
|
"type": "string", |
|
"enum": [ |
|
"period", |
|
"end-of" |
|
] |
|
}, |
|
"time": { |
|
"oneOf": [ |
|
{ |
|
"type": "string", |
|
"enum": [ |
|
"day", |
|
"week" |
|
] |
|
}, |
|
{ |
|
"type": "integer", |
|
"description": "Time offset in seconds" |
|
} |
|
] |
|
} |
|
} |
|
}, |
|
"Type": { |
|
"type": "string", |
|
"enum": [ |
|
"online", |
|
"offline", |
|
"dnd", |
|
"away", |
|
"invisible" |
|
] |
|
}, |
|
"GetStatus": { |
|
"type": "object", |
|
"required": [ |
|
"ocs" |
|
], |
|
"properties": { |
|
"ocs": { |
|
"type": "object", |
|
"required": [ |
|
"meta", |
|
"data" |
|
], |
|
"properties": { |
|
"meta": { |
|
"$ref": "#/components/schemas/OCSMeta" |
|
}, |
|
"data": { |
|
"oneOf": [ |
|
{ |
|
"type": "array", |
|
"items": { |
|
"type": "object" |
|
} |
|
}, |
|
{ |
|
"$ref": "#/components/schemas/Status" |
|
} |
|
] |
|
} |
|
} |
|
} |
|
} |
|
}, |
|
"GetPublicStatuses": { |
|
"type": "object", |
|
"required": [ |
|
"ocs" |
|
], |
|
"properties": { |
|
"ocs": { |
|
"type": "object", |
|
"required": [ |
|
"meta", |
|
"data" |
|
], |
|
"properties": { |
|
"meta": { |
|
"$ref": "#/components/schemas/OCSMeta" |
|
}, |
|
"data": { |
|
"type": "array", |
|
"items": { |
|
"$ref": "#/components/schemas/PublicStatus" |
|
} |
|
} |
|
} |
|
} |
|
} |
|
}, |
|
"GetPublicStatus": { |
|
"type": "object", |
|
"required": [ |
|
"ocs" |
|
], |
|
"properties": { |
|
"ocs": { |
|
"type": "object", |
|
"required": [ |
|
"meta", |
|
"data" |
|
], |
|
"properties": { |
|
"meta": { |
|
"$ref": "#/components/schemas/OCSMeta" |
|
}, |
|
"data": { |
|
"oneOf": [ |
|
{ |
|
"type": "array", |
|
"items": { |
|
"type": "object" |
|
} |
|
}, |
|
{ |
|
"$ref": "#/components/schemas/PublicStatus" |
|
} |
|
] |
|
} |
|
} |
|
} |
|
} |
|
}, |
|
"Status": { |
|
"type": "object", |
|
"required": [ |
|
"userId", |
|
"messageIsPredefined", |
|
"status", |
|
"statusIsUserDefined" |
|
], |
|
"properties": { |
|
"userId": { |
|
"type": "string" |
|
}, |
|
"message": { |
|
"type": "string" |
|
}, |
|
"messageId": { |
|
"type": "string" |
|
}, |
|
"messageIsPredefined": { |
|
"type": "boolean" |
|
}, |
|
"icon": { |
|
"type": "string" |
|
}, |
|
"clearAt": { |
|
"oneOf": [ |
|
{ |
|
"$ref": "#/components/schemas/ClearAt" |
|
}, |
|
{ |
|
"type": "integer", |
|
"description": "Time as unix timestamp" |
|
} |
|
] |
|
}, |
|
"status": { |
|
"$ref": "#/components/schemas/Type" |
|
}, |
|
"statusIsUserDefined": { |
|
"type": "boolean" |
|
} |
|
} |
|
}, |
|
"PublicStatus": { |
|
"type": "object", |
|
"required": [ |
|
"userId", |
|
"status" |
|
], |
|
"properties": { |
|
"userId": { |
|
"type": "string" |
|
}, |
|
"message": { |
|
"type": "string" |
|
}, |
|
"icon": { |
|
"type": "string" |
|
}, |
|
"clearAt": { |
|
"oneOf": [ |
|
{ |
|
"$ref": "#/components/schemas/ClearAt" |
|
}, |
|
{ |
|
"type": "integer", |
|
"description": "Time as unix timestamp" |
|
} |
|
] |
|
}, |
|
"status": { |
|
"$ref": "#/components/schemas/Type" |
|
} |
|
} |
|
}, |
|
"Heartbeat": { |
|
"type": "object", |
|
"required": [ |
|
"ocs" |
|
], |
|
"properties": { |
|
"ocs": { |
|
"type": "object", |
|
"required": [ |
|
"meta", |
|
"data" |
|
], |
|
"properties": { |
|
"meta": { |
|
"$ref": "#/components/schemas/OCSMeta" |
|
}, |
|
"data": { |
|
"$ref": "#/components/schemas/Status" |
|
} |
|
} |
|
} |
|
} |
|
} |
|
}, |
|
"securitySchemes": { |
|
"basic_auth": { |
|
"type": "http", |
|
"scheme": "basic" |
|
} |
|
} |
|
}, |
|
"paths": { |
|
"/ocs/v2.php/apps/user_status/api/v1/statuses": { |
|
"get": { |
|
"operationId": "get-public-statuses", |
|
"tags": [ |
|
"user_status" |
|
], |
|
"responses": { |
|
"200": { |
|
"description": "", |
|
"content": { |
|
"application/json": { |
|
"schema": { |
|
"$ref": "#/components/schemas/GetPublicStatuses" |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
}, |
|
"/ocs/v2.php/apps/user_status/api/v1/statuses/{userId}": { |
|
"parameters": [ |
|
{ |
|
"name": "userId", |
|
"in": "path", |
|
"required": true, |
|
"schema": { |
|
"type": "string" |
|
} |
|
} |
|
], |
|
"get": { |
|
"operationId": "get-public-status", |
|
"tags": [ |
|
"user_status" |
|
], |
|
"responses": { |
|
"200": { |
|
"description": "", |
|
"content": { |
|
"application/json": { |
|
"schema": { |
|
"$ref": "#/components/schemas/GetPublicStatus" |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
}, |
|
"/ocs/v2.php/apps/user_status/api/v1/user_status": { |
|
"get": { |
|
"operationId": "get-status", |
|
"tags": [ |
|
"user_status" |
|
], |
|
"responses": { |
|
"200": { |
|
"description": "", |
|
"content": { |
|
"application/json": { |
|
"schema": { |
|
"$ref": "#/components/schemas/GetStatus" |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
}, |
|
"/ocs/v2.php/apps/user_status/api/v1/user_status/status": { |
|
"put": { |
|
"operationId": "set-status", |
|
"tags": [ |
|
"user_status" |
|
], |
|
"parameters": [ |
|
{ |
|
"name": "statusType", |
|
"in": "query", |
|
"required": true, |
|
"schema": { |
|
"$ref": "#/components/schemas/Type" |
|
} |
|
} |
|
], |
|
"responses": { |
|
"200": { |
|
"description": "", |
|
"content": { |
|
"application/json": { |
|
"schema": { |
|
"$ref": "#/components/schemas/GetStatus" |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
}, |
|
"/ocs/v2.php/apps/user_status/api/v1/user_status/message/predefined": { |
|
"put": { |
|
"operationId": "set-predefined-message", |
|
"tags": [ |
|
"user_status" |
|
], |
|
"parameters": [ |
|
{ |
|
"name": "messageId", |
|
"in": "query", |
|
"required": true, |
|
"schema": { |
|
"type": "string" |
|
} |
|
}, |
|
{ |
|
"name": "clearAt", |
|
"in": "query", |
|
"required": false, |
|
"schema": { |
|
"type": "integer" |
|
} |
|
} |
|
], |
|
"responses": { |
|
"200": { |
|
"description": "", |
|
"content": { |
|
"application/json": { |
|
"schema": { |
|
"$ref": "#/components/schemas/GetStatus" |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
}, |
|
"/ocs/v2.php/apps/user_status/api/v1/user_status/message/custom": { |
|
"put": { |
|
"operationId": "set-custom-message", |
|
"tags": [ |
|
"user_status" |
|
], |
|
"parameters": [ |
|
{ |
|
"name": "statusIcon", |
|
"in": "query", |
|
"required": false, |
|
"schema": { |
|
"type": "string" |
|
} |
|
}, |
|
{ |
|
"name": "message", |
|
"in": "query", |
|
"required": false, |
|
"schema": { |
|
"type": "string" |
|
} |
|
}, |
|
{ |
|
"name": "clearAt", |
|
"in": "query", |
|
"required": false, |
|
"schema": { |
|
"type": "integer" |
|
} |
|
} |
|
], |
|
"responses": { |
|
"200": { |
|
"description": "", |
|
"content": { |
|
"application/json": { |
|
"schema": { |
|
"$ref": "#/components/schemas/GetStatus" |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
}, |
|
"/ocs/v2.php/apps/user_status/api/v1/user_status/message": { |
|
"delete": { |
|
"operationId": "clear-message", |
|
"tags": [ |
|
"user_status" |
|
], |
|
"responses": { |
|
"200": { |
|
"description": "" |
|
} |
|
} |
|
} |
|
}, |
|
"/ocs/v2.php/apps/user_status/api/v1/predefined_statuses": { |
|
"get": { |
|
"operationId": "get-predefined-statuses", |
|
"tags": [ |
|
"user_status" |
|
], |
|
"responses": { |
|
"200": { |
|
"description": "", |
|
"content": { |
|
"application/json": { |
|
"schema": { |
|
"$ref": "#/components/schemas/PredefinedStatuses" |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
}, |
|
"/ocs/v2.php/apps/user_status/api/v1/heartbeat": { |
|
"put": { |
|
"operationId": "heartbeat", |
|
"tags": [ |
|
"user_status" |
|
], |
|
"parameters": [ |
|
{ |
|
"name": "status", |
|
"in": "query", |
|
"required": true, |
|
"schema": { |
|
"$ref": "#/components/schemas/Type" |
|
} |
|
} |
|
], |
|
"responses": { |
|
"200": { |
|
"description": "", |
|
"content": { |
|
"application/json": { |
|
"schema": { |
|
"$ref": "#/components/schemas/Heartbeat" |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
}
|
|
|