{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://malo-browser.dev/schemas/scene.schema.json", "title": "Malo Browser Scene v1", "type": "object", "additionalProperties": false, "required": ["schema_version", "id", "title", "viewport", "steps"], "properties": { "schema_version": { "const": 1 }, "id": { "type": "string", "pattern": "^[a-z0-9-]+$" }, "title": { "type": "string", "minLength": 1 }, "description": { "type": "string" }, "url": { "type": "string", "minLength": 1, "pattern": "^[Hh][Tt][Tt][Pp][Ss]?://" }, "file": { "type": "string", "minLength": 1, "pattern": "^(?!/)(?![A-Za-z]:)(?!.*(?:^|[\\\\/])\\.\\.(?:[\\\\/]|$))(?!.*(?:/{2}|\\\\{2}))(?!.*[\\\\/]$).+$" }, "viewport": { "type": "object", "additionalProperties": false, "required": ["width", "height"], "properties": { "width": { "type": "integer", "minimum": 800, "maximum": 3840 }, "height": { "type": "integer", "minimum": 450, "maximum": 2160 }, "device_scale_factor": { "type": "number", "minimum": 0.5, "maximum": 4 }, "mobile": { "type": "boolean" } } }, "profile": { "type": "string", "minLength": 1 }, "allow": { "type": "array", "items": { "type": "string", "minLength": 1 } }, "permissions": { "type": "array", "items": { "type": "string", "minLength": 1 } }, "reset_policy": { "enum": ["reload", "clear-storage", "new-session"] }, "vars": { "type": "object", "additionalProperties": { "type": "string" } }, "steps": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/step" } }, "record": { "type": "object" } }, "oneOf": [ { "required": ["url"] }, { "required": ["file"] } ], "$defs": { "step": { "type": "object", "additionalProperties": false, "required": ["action"], "properties": { "id": { "type": "string", "minLength": 1 }, "action": { "enum": [ "goto", "login", "wait", "wait_for", "wait_for_presenter", "click", "fill", "press", "scroll", "highlight", "spotlight", "annotate", "mask", "blackout", "assert", "scene", "set", "note", "screenshot" ] }, "note": { "type": "string" }, "advance": { "enum": ["auto", "manual"] }, "hold_ms": { "type": "integer", "minimum": 0, "maximum": 600000 }, "wait_after_ms": { "type": "integer", "minimum": 0, "maximum": 600000 }, "timeout_ms": { "type": "integer", "minimum": 1, "maximum": 600000 }, "optional": { "type": "boolean" }, "on_error": { "enum": ["stop", "warn"] }, "data_demo_id": { "type": "string", "minLength": 1 }, "selector": { "type": "string", "minLength": 1 }, "text": { "type": "string", "minLength": 1 }, "url": { "type": "string", "minLength": 1 }, "wait_until": { "enum": ["load", "domcontentloaded", "networkidle"] }, "seconds": { "type": "number", "minimum": 0, "maximum": 3600 }, "state": { "enum": ["visible", "hidden", "attached"] }, "button": { "enum": ["left", "middle", "right"] }, "click_count": { "type": "integer", "minimum": 1, "maximum": 10 }, "clear": { "type": "boolean" }, "key_events": { "type": "boolean" }, "key": { "type": "string", "minLength": 1 }, "dx": { "type": "number" }, "dy": { "type": "number" }, "behavior": { "enum": ["auto", "instant", "smooth"] }, "color": { "type": "string", "minLength": 1 }, "padding": { "type": "number", "minimum": 0, "maximum": 500 }, "dim": { "type": "number", "minimum": 0, "maximum": 1 }, "x": { "type": "number" }, "y": { "type": "number" }, "position": { "enum": ["top", "bottom", "left", "right"] }, "until": { "enum": ["scene-end"] }, "mode": { "enum": ["blur", "solid"] }, "on": { "type": "boolean" }, "visible": { "type": "string", "minLength": 1 }, "value": { "type": "string" }, "count": { "type": "integer", "minimum": 0 }, "scene_id": { "type": "string", "minLength": 1 }, "account_id": { "type": "string", "pattern": "^[a-z0-9-]+$" }, "name": { "type": "string", "minLength": 1 }, "path": { "type": "string", "minLength": 1, "pattern": "^(?!/)(?![A-Za-z]:)(?!.*(?:^|[\\\\/])\\.\\.(?:[\\\\/]|$))(?!.*(?:/{2}|\\\\{2}))(?!.*[\\\\/]$).+$" } }, "allOf": [ { "if": { "properties": { "action": { "const": "goto" } }, "required": ["action"] }, "then": { "required": ["url"] } }, { "if": { "properties": { "action": { "const": "login" } }, "required": ["action"] }, "then": { "required": ["account_id"] } }, { "if": { "properties": { "action": { "const": "wait" } }, "required": ["action"] }, "then": { "required": ["seconds"] } }, { "if": { "properties": { "action": { "const": "wait_for" } }, "required": ["action"] }, "then": { "anyOf": [ { "required": ["selector"] }, { "required": ["text"] }, { "required": ["url"] } ] } }, { "if": { "properties": { "action": { "enum": ["click", "highlight", "spotlight", "mask"] } }, "required": ["action"] }, "then": { "anyOf": [ { "required": ["data_demo_id"] }, { "required": ["selector"] }, { "required": ["text"] } ] } }, { "if": { "properties": { "action": { "const": "fill" } }, "required": ["action"] }, "then": { "required": ["text"], "anyOf": [ { "required": ["data_demo_id"] }, { "required": ["selector"] } ] } }, { "if": { "properties": { "action": { "const": "annotate" } }, "required": ["action"] }, "then": { "required": ["text"], "anyOf": [ { "required": ["data_demo_id"] }, { "required": ["selector"] }, { "required": ["x", "y"] } ] } }, { "if": { "properties": { "action": { "const": "assert" } }, "required": ["action"] }, "then": { "anyOf": [ { "required": ["visible"] }, { "required": ["text"] }, { "required": ["value"] }, { "required": ["url"] }, { "required": ["count"] } ] } }, { "if": { "properties": { "action": { "const": "press" } }, "required": ["action"] }, "then": { "required": ["key"] } }, { "if": { "properties": { "action": { "const": "blackout" } }, "required": ["action"] }, "then": { "required": ["on"] } }, { "if": { "properties": { "action": { "const": "scene" } }, "required": ["action"] }, "then": { "required": ["scene_id"] } }, { "if": { "properties": { "action": { "const": "set" } }, "required": ["action"] }, "then": { "required": ["name"] } }, { "if": { "properties": { "action": { "const": "screenshot" } }, "required": ["action"] }, "then": { "required": ["path"] } }, { "if": { "properties": { "optional": { "const": true } }, "required": ["optional"] }, "then": { "properties": { "action": { "enum": ["highlight", "spotlight", "annotate"] } } } } ] } } }