{
  "$schema": "https://json-schema.org/draft/2019-09/schema",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "version": {
      "type": "string"
    },
    "main": {
      "type": "string"
    },
    "inputs": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/input"
      }
    },
    "sheetSettings": {
      "type": "object",
      "properties": {
        "defaultCols": {
          "type": "number"
        },
        "defaultRows": {
          "type": "number"
        },
        "maxCols": {
          "type": "number"
        },
        "maxRows": {
          "type": "number"
        },
        "minCols": {
          "type": "number"
        },
        "minRows": {
          "type": "number"
        }
      },
      "required": [
        "minCols",
        "minRows"
      ],
      "additionalProperties": false
    },
    "cardSettings": {
      "type": "object",
      "properties": {
        "defaultHeight": {
          "type": "number"
        },
        "maxHeight": {
          "type": "number"
        },
        "minHeight": {
          "type": "number"
        }
      },
      "required": [
        "minHeight"
      ],
      "additionalProperties": false
    },
    "reportSettings": {
      "type": "object",
      "properties": {
        "defaultCols": {
          "type": "number"
        },
        "defaultRows": {
          "type": "number"
        },
        "maxCols": {
          "type": "number"
        },
        "maxRows": {
          "type": "number"
        },
        "minCols": {
          "type": "number"
        },
        "minRows": {
          "type": "number"
        }
      },
      "required": [
        "minCols",
        "minRows"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "version",
    "main",
    "inputs"
  ],
  "additionalProperties": false,
  "$id": "http://ayayot.com/schemas/component-manifest.json",
  "definitions": {
    "input": {
      "anyOf": [
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "disabled": {
              "type": "boolean",
              "default": false
            },
            "placeholder": {
              "type": "string"
            },
            "required": {
              "type": "boolean",
              "default": false
            },
            "type": {
              "$ref": "#/definitions/simpleBooleanTypes"
            },
            "defaultValue": {
              "type": "boolean"
            },
            "key": {
              "type": "string"
            },
            "description": {
              "type": "string",
              "description": "A Markdown or plain text string describing the input."
            },
            "label": {
              "type": "string"
            }
          },
          "required": [
            "key",
            "label",
            "type"
          ]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "disabled": {
              "type": "boolean",
              "default": false
            },
            "placeholder": {
              "type": "string"
            },
            "required": {
              "type": "boolean",
              "default": false
            },
            "type": {
              "$ref": "#/definitions/simpleFileTypes"
            },
            "multiple": {
              "type": "boolean",
              "default": false
            },
            "defaultValue": {
              "type": "string"
            },
            "size": {
              "type": "object",
              "properties": {
                "max": {
                  "type": "number"
                }
              },
              "required": [
                "max"
              ],
              "additionalProperties": false
            },
            "key": {
              "type": "string"
            },
            "description": {
              "type": "string",
              "description": "A Markdown or plain text string describing the input."
            },
            "label": {
              "type": "string"
            }
          },
          "required": [
            "key",
            "label",
            "type"
          ]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "disabled": {
              "type": "boolean",
              "default": false
            },
            "placeholder": {
              "type": "string"
            },
            "required": {
              "type": "boolean",
              "default": false
            },
            "type": {
              "$ref": "#/definitions/simpleNumberTypes"
            },
            "defaultValue": {
              "type": "number"
            },
            "min": {
              "type": "number"
            },
            "max": {
              "type": "number"
            },
            "step": {
              "type": "number"
            },
            "key": {
              "type": "string"
            },
            "description": {
              "type": "string",
              "description": "A Markdown or plain text string describing the input."
            },
            "label": {
              "type": "string"
            }
          },
          "required": [
            "key",
            "label",
            "type"
          ]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "disabled": {
              "type": "boolean",
              "default": false
            },
            "placeholder": {
              "type": "string"
            },
            "required": {
              "type": "boolean",
              "default": false
            },
            "type": {
              "$ref": "#/definitions/simpleSelectionTypes"
            },
            "defaultValue": {
              "type": [
                "string",
                "number"
              ]
            },
            "options": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string",
                    "description": "A label describing the value"
                  },
                  "shortLabel": {
                    "type": "string",
                    "description": "A label that is used if there is too little space for the full label"
                  },
                  "value": {
                    "type": [
                      "string",
                      "number"
                    ]
                  }
                },
                "required": [
                  "label",
                  "value"
                ],
                "additionalProperties": false
              }
            },
            "key": {
              "type": "string"
            },
            "description": {
              "type": "string",
              "description": "A Markdown or plain text string describing the input."
            },
            "label": {
              "type": "string"
            }
          },
          "required": [
            "key",
            "label",
            "type"
          ]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "disabled": {
              "type": "boolean",
              "default": false
            },
            "placeholder": {
              "type": "string"
            },
            "required": {
              "type": "boolean",
              "default": false
            },
            "type": {
              "$ref": "#/definitions/simpleResourceSelectionTypes"
            },
            "resource": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "AgentDataTag",
                    "AssetAppConfigResource"
                  ]
                }
              },
              "required": [
                "type"
              ],
              "additionalProperties": false
            },
            "key": {
              "type": "string"
            },
            "description": {
              "type": "string",
              "description": "A Markdown or plain text string describing the input."
            },
            "label": {
              "type": "string"
            }
          },
          "required": [
            "key",
            "label",
            "resource",
            "type"
          ]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "disabled": {
              "type": "boolean",
              "default": false
            },
            "placeholder": {
              "type": "string"
            },
            "required": {
              "type": "boolean",
              "default": false
            },
            "type": {
              "$ref": "#/definitions/simpleTranslatableTypes"
            },
            "defaultValue": {
              "type": "string"
            },
            "translate": {
              "type": "boolean",
              "default": true
            },
            "pattern": {
              "type": "string",
              "description": "Validation pattern, expressed as a JavaScript regular expression"
            },
            "patternHint": {
              "type": "string",
              "description": "Hint to be displayed with the input when the pattern does not match"
            },
            "key": {
              "type": "string"
            },
            "description": {
              "type": "string",
              "description": "A Markdown or plain text string describing the input."
            },
            "label": {
              "type": "string"
            }
          },
          "required": [
            "key",
            "label",
            "type"
          ]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "disabled": {
              "type": "boolean",
              "default": false
            },
            "placeholder": {
              "type": "string"
            },
            "required": {
              "type": "boolean",
              "default": false
            },
            "type": {
              "$ref": "#/definitions/simpleStringTypes"
            },
            "defaultValue": {
              "type": "string"
            },
            "key": {
              "type": "string"
            },
            "description": {
              "type": "string",
              "description": "A Markdown or plain text string describing the input."
            },
            "label": {
              "type": "string"
            }
          },
          "required": [
            "key",
            "label",
            "type"
          ]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "type": {
              "$ref": "#/definitions/ListTypes"
            },
            "itemType": {
              "$ref": "#/definitions/input"
            },
            "key": {
              "type": "string"
            },
            "description": {
              "type": "string",
              "description": "A Markdown or plain text string describing the input."
            },
            "label": {
              "type": "string"
            }
          },
          "required": [
            "key",
            "label",
            "type"
          ]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "type": {
              "$ref": "#/definitions/groupTypes"
            },
            "summary": {
              "type": "object",
              "properties": {
                "label": {
                  "type": "string"
                },
                "colorField": {
                  "type": "string"
                }
              },
              "required": [
                "label"
              ],
              "additionalProperties": false
            },
            "children": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/input"
              }
            },
            "key": {
              "type": "string"
            },
            "description": {
              "type": "string",
              "description": "A Markdown or plain text string describing the input."
            },
            "label": {
              "type": "string"
            }
          },
          "required": [
            "children",
            "key",
            "label",
            "type"
          ]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "type": {
              "$ref": "#/definitions/metricTypes"
            },
            "allowedTypes": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "bool",
                  "int",
                  "float",
                  "str"
                ]
              },
              "description": "The types of tags or variables that are allowed for this metric. All types are allowed if empty ([]), null or not specified."
            },
            "placeholder": {
              "type": "string"
            },
            "required": {
              "type": "boolean",
              "default": false
            },
            "key": {
              "type": "string"
            },
            "description": {
              "type": "string",
              "description": "A Markdown or plain text string describing the input."
            },
            "label": {
              "type": "string"
            }
          },
          "required": [
            "key",
            "label",
            "type"
          ]
        }
      ]
    },
    "simpleBooleanTypes": {
      "type": "string",
      "const": "Checkbox"
    },
    "simpleFileTypes": {
      "type": "string",
      "const": "File"
    },
    "simpleNumberTypes": {
      "type": "string",
      "const": "Number"
    },
    "simpleSelectionTypes": {
      "type": "string",
      "const": "Selection"
    },
    "simpleResourceSelectionTypes": {
      "type": "string",
      "const": "ResourceSelection"
    },
    "simpleTranslatableTypes": {
      "type": "string",
      "enum": [
        "RichText",
        "String",
        "Text"
      ]
    },
    "simpleStringTypes": {
      "type": "string",
      "enum": [
        "Color",
        "Date",
        "DateTime",
        "Icon",
        "Image",
        "MaterialIcon"
      ]
    },
    "ListTypes": {
      "type": "string",
      "const": "List"
    },
    "groupTypes": {
      "type": "string",
      "const": "Group"
    },
    "metricTypes": {
      "type": "string",
      "enum": [
        "LiveMetric",
        "RawMetric",
        "AggregatedMetric"
      ]
    }
  }
}