From 2ab9c82ccb20d9dc1fea3a1e55d379833bbf2b61 Mon Sep 17 00:00:00 2001 From: 2mal3 <56305732+2mal3@users.noreply.github.com> Date: Tue, 18 Nov 2025 12:43:51 +0100 Subject: [PATCH] docs(display): api (#2) * docs(display): api * docs(display/keyboardInput): more generic interface * docs(display): clarify error section --- display/README.md | 102 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 display/README.md diff --git a/display/README.md b/display/README.md new file mode 100644 index 0000000..39d5790 --- /dev/null +++ b/display/README.md @@ -0,0 +1,102 @@ +# API + +All response and request bodies are `application/json` if not otherwise specified. If no response schema is specified an empty json object `{}` is returned. + +## Default + +### Responses + +#### All Errors + +If not specified otherwise. + +- `description`: string + +#### 400 + +Request uses invalid JSON syntax or does not follow request schema. + +#### 500 + +Something (undefined) on the display side has gone very wrong. + +## GET `/ping` + +### Responses + +#### 200 + +- `version`: str + +## PATCH `/shellCommand` + +### Responses + +#### 200 + +Even when the command itself fails. + +- `stdout`: string +- `stderr`: string +- `exitCode`: int + +## PATCH `/keyboardInput` + +### Request Body + +- `key`: string for key +- `action`: "press" or "release" + +## PATCH `/showHTML` + +### Request Body + +- `html`: string + +## PATCH `/takeScreenshot` + +### Responses + +#### 200 + +The screenshot as binary in the response body. + +## POST `/file/` - Upload File + +### Responses + +#### 409 - Conflict + +File with the same path and name already exists. + +## GET `/file/` + +### Responses + +#### 404 + +Requested file was not found at the path. + +## PATCH `/file/` - Open File + +### Responses + +#### 404 + +Requested file was not found at the path. + +#### 415 - Unsupported Media Type + +The type of the file is not available for display. + +## GET `/file/preview/` + +### Responses + +#### 404 + +Requested file was not found at the path. + +#### 415 - Unsupported Media Type + +The type of the file is not available preview generation.