{
  "source": "./http.js",
  "method": "sendResponse",
  "input-schema": {
    "type": "object",
    "dynamicInputFilter": true,
    "additionalProperties": false,
    "properties": {
      "headers": {
        "type": "array",
        "items": {
          "type": "object",
          "title": "header",
          "properties": {
            "key": {
              "type": "string",
              "enum": [
                "Access-Control-Allow-Origin",
                "Access-Control-Allow-Credentials",
                "Access-Control-Expose-Headers",
                "Access-Control-Max-Age",
                "Access-Control-Allow-Methods",
                "Access-Control-Allow-Headers",
                "Accept-Patch",
                "Accept-Ranges",
                "Age",
                "Allow",
                "Alt-Svc",
                "Cache-Control",
                "Connection",
                "Content-Disposition",
                "Content-Encoding",
                "Content-Language",
                "Content-Length",
                "Content-Location",
                "Content-MD5",
                "Content-Range",
                "Content-Type",
                "Date",
                "Delta-Base",
                "ETag",
                "Expires",
                "IM",
                "Last-Modified",
                "Link",
                "Location",
                "P3P",
                "Pragma",
                "Proxy-Authenticate",
                "Public-Key-Pins",
                "Retry-After",
                "Server",
                "Set-Cookie",
                "Strict-Transport-Security",
                "Trailer",
                "Transfer-Encoding",
                "Tk",
                "Upgrade",
                "Vary",
                "Via",
                "Warning",
                "WWW-Authenticate",
                "X-Frame-Options"
              ]
            },
            "value": {"type": "string"}
          },
          "additionalProperties": false
        },
        "description": "Set response headers."
      },
      "status": {
        "title": "statusCode",
        "type": "integer",
        "default": "200"
      },
      "type": {
        "title": "responseType",
        "description": "Specify the type of the response. The Content-Type header will be automatically set based on selected type. Specify custom to set Content-Type manually.",
        "type": "string",
        "format": "choice",
        "choice": [
          {"label": "custom", "value": "\"custom\""},
          {"label": "json (application/json)", "value": "\"json\""},
          {"label": "jsonp (application/javascript)", "value": "\"jsonp\""},
          {"label": "html (text/html)", "value": "\"html\""},
          {"label": "plain (text/plain)", "value": "\"plain\""}
        ]
      },
      "contentType": {
        "type": "string",
        "enum": [
          "text/html",
          "text/plain",
          "application/json",
          "application/xml",
          "image/bmp",
          "image/gif",
          "image/jpeg",
          "image/png",
          "application/epub+zip",
          "application/gzip",
          "application/java-archive",
          "application/ld+json",
          "application/msword",
          "application/octet-stream",
          "application/ogg",
          "application/pdf",
          "application/rtf",
          "application/vnd.amazon.ebook",
          "application/vnd.apple.installer+xml",
          "application/vnd.mozilla.xul+xml",
          "application/vnd.ms-excel",
          "application/vnd.ms-fontobject",
          "application/vnd.ms-powerpoint",
          "application/vnd.oasis.opendocument.presentation",
          "application/vnd.oasis.opendocument.spreadsheet",
          "application/vnd.oasis.opendocument.text",
          "application/vnd.openxmlformats-officedocument.presentationml.presentation",
          "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
          "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
          "application/vnd.rar",
          "application/vnd.visio",
          "application/x-7z-compressed",
          "application/x-abiword",
          "application/x-bzip",
          "application/x-bzip2",
          "application/x-csh",
          "application/x-freearc",
          "application/x-httpd-php",
          "application/x-sh",
          "application/x-shockwave-flash",
          "application/x-tar",
          "application/xhtml+xml",
          "application/zip",
          "audio/3gpp",
          "audio/3gpp2",
          "audio/aac",
          "audio/midi audio/x-midi",
          "audio/mpeg",
          "audio/ogg",
          "audio/opus",
          "audio/wav",
          "audio/webm",
          "font/otf",
          "font/ttf",
          "font/woff",
          "font/woff2",
          "image/svg+xml",
          "image/tiff",
          "image/vnd.microsoft.icon",
          "image/webp",
          "text/calendar",
          "text/css",
          "text/csv",
          "text/javascript",
          "video/3gpp",
          "video/3gpp2",
          "video/mp2t",
          "video/mpeg",
          "video/ogg",
          "video/webm",
          "video/x-msvideo"
        ],
        "description": "Select a value for Content-Type or type a custom value. The value if specified will override the Content-Type header even if set."
      },
      "content": {
        "type": "any",
        "description": "Body of the response. Can be string, object, buffer, file path or a stream depending on the content type."
      },
      "advanced": {
        "type": "object",
        "properties": {
          "charset": {
            "description": "Defaults to utf8",
            "enum": ["ascii", "utf8", "utf-8", "binary", "latin1", "hex", "base64", "base64url", "ucs2", "ucs-2", "utf16le", "utf-16le"],
            "type": "string"
          }
        },
        "additionalProperties": false
      }
    }
  },
  "output-schema": {
    "type": "object",
    "success": {
      "type": "boolean",
      "required": true
    }
  },
  "meta": {
    "name": "sendResponse",
    "description": "Send response to the current HTTP request"
  }
}