{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://appy.sh/appy.schema.json",
  "title": "appy.json",
  "description": "Declares a web app for Appy. Served at /.well-known/appy.json. Web app manifest members (name, start_url, scope, theme_color, icons, shortcuts) are read as in a manifest; the members below are Appy's own. Inside a web app manifest the same three members go under an \"appy\" object.",
  "type": "object",
  "properties": {
    "name": {
      "type": "string"
    },
    "short_name": {
      "type": "string"
    },
    "start_url": {
      "type": "string"
    },
    "scope": {
      "type": "string"
    },
    "theme_color": {
      "type": "string"
    },
    "background_color": {
      "type": "string",
      "description": "The window's colour until the page has loaded. After that the window follows the page's own background."
    },
    "icons": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "src"
        ],
        "properties": {
          "src": {
            "type": "string"
          },
          "sizes": {
            "type": "string"
          },
          "purpose": {
            "type": "string"
          }
        }
      }
    },
    "shortcuts": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "name",
          "url"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        }
      }
    },
    "capabilities": {
      "type": "array",
      "uniqueItems": true,
      "items": {
        "enum": [
          "notifications",
          "badge",
          "commands",
          "tray",
          "shortcut"
        ]
      }
    },
    "window": {
      "type": "object",
      "properties": {
        "width": {
          "type": "number",
          "description": "Points. Default 1200."
        },
        "height": {
          "type": "number",
          "description": "Points. Default 800."
        },
        "titleBar": {
          "enum": [
            "default",
            "hidden"
          ]
        },
        "trafficLights": {
          "type": "object",
          "description": "With titleBar \"hidden\": the gap in points between the window's top left corner and the first window button. Default: a little lower than macOS puts them, centred in a 44-point strip.",
          "properties": {
            "x": {
              "type": "number",
              "minimum": 0,
              "maximum": 60
            },
            "y": {
              "type": "number",
              "minimum": 0,
              "maximum": 60
            }
          },
          "required": [
            "x",
            "y"
          ]
        }
      }
    },
    "commands": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "id",
          "title"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "description": "An in-scope address to open. Without it the page receives the command through appy.commands.on(id, handler)."
          },
          "keywords": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      }
    }
  }
}
