Files

447 lines
9.0 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://prometeu.dev/headless/v1/request.schema.json",
"title": "Prometeu Headless v1.2 Request",
"type": "object",
"additionalProperties": false,
"required": [
"requestId",
"command",
"params"
],
"properties": {
"requestId": {
"type": "string",
"minLength": 1,
"maxLength": 128
},
"command": {
"type": "string"
},
"params": {
"type": "object"
}
},
"oneOf": [
{
"properties": {
"command": {
"const": "initialize"
},
"params": {
"type": "object",
"additionalProperties": false,
"required": [
"protocolVersion",
"requiredCapabilities"
],
"properties": {
"protocolVersion": {
"$ref": "#/$defs/version"
},
"requiredCapabilities": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
},
{
"properties": {
"command": {
"const": "boot"
},
"params": {
"type": "object",
"additionalProperties": false,
"required": [
"path"
],
"properties": {
"path": {
"type": "string",
"minLength": 1,
"pattern": "\\S"
},
"memcardChoice": {
"enum": [
"persistent",
"memory_fresh",
"memory_existing"
]
}
}
}
}
},
{
"properties": {
"command": {
"const": "advance"
},
"params": {
"type": "object",
"additionalProperties": false,
"required": [
"frames"
],
"properties": {
"frames": {
"type": "integer",
"minimum": 0,
"maximum": 18446744073709551615
}
}
}
}
},
{
"properties": {
"command": {
"const": "set_input"
},
"params": {
"$ref": "#/$defs/input"
}
}
},
{
"properties": {
"command": {
"const": "cancel"
},
"params": {
"type": "object",
"additionalProperties": false,
"required": [
"targetRequestId"
],
"properties": {
"targetRequestId": {
"type": "string",
"minLength": 1,
"maxLength": 128
}
}
}
}
},
{
"properties": {
"command": {
"const": "reset"
},
"params": {
"type": "object",
"properties": {
"discardUnsaved": {
"type": "boolean"
},
"pendingWrites": {
"enum": [
"wait",
"cancel"
]
}
},
"required": [],
"additionalProperties": false
}
}
},
{
"properties": {
"command": {
"const": "clear_input"
},
"params": {
"type": "object",
"maxProperties": 0
}
}
},
{
"properties": {
"command": {
"const": "capture"
},
"params": {
"type": "object",
"maxProperties": 0
}
}
},
{
"properties": {
"command": {
"const": "get_state"
},
"params": {
"type": "object",
"maxProperties": 0
}
}
},
{
"properties": {
"command": {
"const": "get_fault"
},
"params": {
"type": "object",
"maxProperties": 0
}
}
},
{
"properties": {
"command": {
"const": "shutdown"
},
"params": {
"type": "object",
"properties": {
"discardUnsaved": {
"type": "boolean"
},
"pendingWrites": {
"enum": [
"wait",
"cancel"
]
}
},
"required": [],
"additionalProperties": false
}
}
},
{
"properties": {
"command": {
"const": "memcard_mount"
},
"params": {
"type": "object",
"properties": {
"path": {
"type": "string",
"minLength": 1,
"pattern": "\\S"
},
"action": {
"enum": [
"open",
"create"
]
},
"access": {
"enum": [
"read_write",
"read_only"
]
}
},
"required": [
"path",
"action",
"access"
],
"additionalProperties": false,
"not": {
"properties": {
"action": {
"const": "create"
},
"access": {
"const": "read_only"
}
},
"required": [
"action",
"access"
]
}
}
}
},
{
"properties": {
"command": {
"const": "memcard_unmount"
},
"params": {
"type": "object",
"properties": {},
"required": [],
"additionalProperties": false
}
}
},
{
"properties": {
"command": {
"const": "get_memcard_state"
},
"params": {
"type": "object",
"properties": {},
"required": [],
"additionalProperties": false
}
}
},
{
"properties": {
"command": {
"const": "memcard_reconcile"
},
"params": {
"type": "object",
"properties": {},
"required": [],
"additionalProperties": false
}
}
},
{
"properties": {
"command": {
"const": "memcard_continue_in_memory"
},
"params": {
"type": "object",
"properties": {},
"required": [],
"additionalProperties": false
}
}
},
{
"properties": {
"command": {
"const": "get_logs"
},
"params": {
"type": "object",
"additionalProperties": false,
"required": [
"afterSequence",
"limit"
],
"properties": {
"afterSequence": {
"type": [
"integer",
"null"
],
"minimum": 0,
"maximum": 18446744073709551615
},
"limit": {
"type": "integer",
"minimum": 1,
"maximum": 1024
}
}
}
}
}
],
"$defs": {
"version": {
"type": "object",
"additionalProperties": false,
"required": [
"major",
"minor"
],
"properties": {
"major": {
"type": "integer",
"minimum": 0,
"maximum": 4294967295
},
"minor": {
"type": "integer",
"minimum": 0,
"maximum": 4294967295
}
}
},
"input": {
"type": "object",
"additionalProperties": false,
"properties": {
"up": {
"type": "boolean",
"default": false
},
"down": {
"type": "boolean",
"default": false
},
"left": {
"type": "boolean",
"default": false
},
"right": {
"type": "boolean",
"default": false
},
"a": {
"type": "boolean",
"default": false
},
"b": {
"type": "boolean",
"default": false
},
"x": {
"type": "boolean",
"default": false
},
"y": {
"type": "boolean",
"default": false
},
"l": {
"type": "boolean",
"default": false
},
"r": {
"type": "boolean",
"default": false
},
"start": {
"type": "boolean",
"default": false
},
"select": {
"type": "boolean",
"default": false
},
"touch": {
"type": "boolean",
"default": false
},
"touchX": {
"type": "integer",
"minimum": -2147483648,
"maximum": 2147483647,
"default": 0
},
"touchY": {
"type": "integer",
"minimum": -2147483648,
"maximum": 2147483647,
"default": 0
}
}
}
}
}