{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Keep a frame app, checked as place.hud.publishApp checks one, for 30 minutes in this server's memory, to run at /a/preview/<id> as a published one runs: its writes answered as a preview's, never sent, its entries those of app where given. Nothing reaches the person's PDS. Requires auth: the workspace's web session (its cookie, with X-HUD: 1 and the server's own Origin) or a HUD access token as Bearer.",
      "errors": [
        {
          "description": "The app is not one HUD runs: what is wrong is named.",
          "name": "InvalidRequest"
        },
        {
          "description": "No live web session or HUD access token: sign in.",
          "name": "AuthRequired"
        },
        {
          "description": "This server keeps as many previews as it holds: try again in a while.",
          "name": "LimitReached"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "app": {
              "description": "The published app it would replace, whose entries the preview reads.",
              "format": "at-uri",
              "type": "string"
            },
            "html": {
              "description": "Its document, UTF-8, everything it loads inline.",
              "maxLength": 2000000,
              "type": "string"
            },
            "kinds": {
              "description": "Its kinds of entry, each a name (1 to 64 letters and digits in lowerCamelCase) and a lexicon object def.",
              "items": {
                "ref": "place.hud.app#kind",
                "type": "ref"
              },
              "maxLength": 16,
              "minLength": 1,
              "type": "array"
            },
            "name": {
              "description": "What the app is called.",
              "maxGraphemes": 64,
              "maxLength": 640,
              "type": "string"
            },
            "summary": {
              "description": "What it is.",
              "maxGraphemes": 300,
              "maxLength": 3000,
              "type": "string"
            },
            "words": {
              "description": "Its words by language, en among them.",
              "type": "unknown"
            },
            "writers": {
              "description": "Who alone may write its entries: anyone where it is left out.",
              "items": {
                "ref": "place.hud.app#writer",
                "type": "ref"
              },
              "maxLength": 200,
              "type": "array"
            }
          },
          "required": [
            "name",
            "html",
            "kinds"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "preview": {
              "description": "The preview's id: 26 characters of a-z and 2-7.",
              "maxLength": 26,
              "minLength": 26,
              "type": "string"
            },
            "url": {
              "description": "Its page's path: /a/preview/<id>.",
              "maxLength": 64,
              "type": "string"
            }
          },
          "required": [
            "preview",
            "url"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "description": "Preview a frame app before publishing it.",
  "id": "place.hud.previewApp",
  "lexicon": 1
}
