{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://mfeflow.github.io/mfeflow/schema/mfeflow-app.json",
  "title": "mfeflow.app.json",
  "type": "object",
  "properties": {
    "$schema": {
      "type": "string"
    },
    "name": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9]*(?:_[a-z][a-z0-9]*)*$"
    },
    "owner": {
      "type": "string"
    },
    "contact": {
      "type": "string"
    },
    "shells": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[a-z][a-z0-9]*(?:_[a-z][a-z0-9]*)*$"
      }
    },
    "routes": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^\\/[A-Za-z0-9/_:*.-]*$"
      },
      "uniqueItems": true
    },
    "exposes": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^\\.\\/[A-Za-z0-9_/-]+$"
      }
    },
    "events": {
      "type": "object",
      "properties": {
        "publishes": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]*(\\.[a-z][a-z0-9-]*)+\\.v[1-9][0-9]*$"
          }
        },
        "consumes": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9-]*(\\.[a-z][a-z0-9-]*)+\\.v[1-9][0-9]*$"
          }
        }
      },
      "required": [
        "publishes",
        "consumes"
      ]
    },
    "analyticsEvents": {
      "type": "array",
      "items": {
        "type": "string",
        "pattern": "^[a-z][a-z0-9]*(_[a-z0-9]+)+$"
      }
    },
    "budgets": {
      "type": "object",
      "properties": {
        "initialJsKb": {
          "type": "number",
          "minimum": 1
        },
        "lcpMs": {
          "type": "number",
          "minimum": 1
        }
      }
    },
    "platform": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    }
  },
  "required": [
    "name",
    "owner",
    "shells",
    "routes",
    "exposes"
  ]
}
