{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "definitions": {
    "environment": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "endpoint": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "host": {
              "type": "string"
            },
            "port": {
              "type": "number",
              "minimum": 1,
              "maximum": 65535
            },
            "user": {
              "type": "string"
            },
            "pemFile": {
              "type": "string"
            }
          },
          "required": [
            "host",
            "user"
          ]
        },
        "ssh": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "path": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "object",
                  "additionalProperties": {
                    "type": "string"
                  }
                }
              ]
            },
            "su": {
              "type": "boolean"
            },
            "passwordPrompt": {
              "type": "boolean"
            }
          },
          "required": [
            "path"
          ]
        },
        "projectConfiguration": {
          "description": "`ng build --configuration=<projectConfiguration>` - If not specified, **production** will be used",
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "array",
              "items": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "architect": {
                        "type": "string"
                      },
                      "configuration": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "configuration"
                    ]
                  }
                ]
              }
            }
          ]
        },
        "targetUrl": {
          "type": "string"
        },
        "deleteOldBuild": {
          "description": "Delete build on target machine before patching new content, not working with `directDeploy`",
          "type": "boolean"
        },
        "directDeploy": {
          "description": "If set to true, upload files directly to target ssh path. Otherwise, zip build, upload to target temp path, then unzip to target ssh path",
          "type": "boolean"
        },
        "postBuildCommand": {
          "description": "Command to run after build",
          "anyOf": [
            {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              ]
            },
            {
              "type": "object",
              "additionalProperties": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                ]
              }
            }
          ]
        },
        "postDeployCommand": {
          "description": "Command to run after deploy",
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          ]
        },
        "libraryPath": {
          "description": "Additional path for build integrity determination",
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          ]
        },
        "display": {
          "type": "string",
          "enum": [
            "default",
            "selected",
            "hidden",
            "disabled"
          ]
        },
        "title": {
          "description": "Title of environment. Contains `url`, `path`, `baseHref` or any fields of config. Mustache render, color access via `color`, e.g., \"{#color.red}{name}{/color.red}\"",
          "type": "string"
        },
        "ngProject": {
          "description": "`ng build [ngProject]`",
          "type": "string"
        },
        "nodeOptions": {
          "type": "object",
          "additionalProperties": {
            "type": [
              "string",
              "number",
              "boolean"
            ]
          }
        }
      },
      "required": [
        "endpoint",
        "ssh"
      ]
    }
  },
  "type": "object",
  "title": "NgxSshDeployConfig",
  "properties": {
    "$schema": {
      "type": "string"
    },
    "environments": {
      "type": "object",
      "additionalProperties": {
        "$ref": "#/definitions/environment"
      }
    },
    "defaultEnvironment": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      ]
    }
  },
  "required": [
    "environments"
  ]
}
