{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://schemas.apps.smartmate.io/apps/app-file.schema.json",
  "$$target": "https://schemas.apps.smartmate.io/apps/app-file.schema.json",
  "type": "object",
  "title": "App File",
  "description": "An app file determines the root of an Smartmate app. It contains the application definition and settings.",
  "required": [
    "id",
    "type",
    "name"
  ],
  "properties": {
    "id": {
      "$id": "#/properties/id",
      "type": "string",
      "description": "It should be unique in the workspace. It should start with a letter and can contain only letters and numbers. Cannot be 'public' or 'common'.",
      "minLength": 2,
      "maxLength": 40,
      "pattern": "^(?!([p|P][u|U][b|B][l|L][i|I][c|C]$))(?!([c|C][o|O][m|M][m|M][o|O][n|N]$))[a-zA-Z][a-zA-Z0-9]+$",
      "examples": ["customerService", "recruitment"]
    },
    "type": {
      "$id": "#/properties/type",
      "description": "File type. It must be 'app'.",
      "type": "string",
      "enum": ["app"],
      "default": "app"
    },
    "name": {
      "description": "App name",
      "$id": "#/properties/spec/properties/name",
      "$ref": "https://schemas.apps.smartmate.io/patterns/name.schema.json"
    },
    "description": {
      "$id": "#/properties/spec/properties/description",
      "type": "string",
      "description": "Description of the app"
    },
    "icon": {
      "description": "App icon. Smartmate uses font awesome icons. See https://fontawesome.com/icons?d=gallery&s=solid&m=free for a list of icons you can use.",
      "examples": ["address-book", "server"],
      "$id": "#/properties/spec/properties/icon",
      "$ref": "https://schemas.apps.smartmate.io/patterns/icon.schema.json"
    },
    "color": {
      "description": "App color",
      "examples": ["#193152", "#CCC"],
      "$id": "#/properties/spec/properties/color",
      "$ref": "https://schemas.apps.smartmate.io/patterns/color.schema.json"
    },
    "active": {
      "type": "boolean",
      "description": "Whether the app is active or not.",
      "$id": "#/properties/spec/properties/active",
      "default": true
    },
    "menuItems": {
      "$id": "#/properties/menu",
      "description": "DEPRECATED in favor of items",
      "$ref": "https://schemas.apps.smartmate.io/apps/menu/menu.schema.json",
      "deprecated": true
    },
    "roles": {
      "$id": "#/properties/roles",
      "description": ":ref:`App roles <app-roles>` defined for this app.",
      "$ref": "https://schemas.apps.smartmate.io/apps/roles/roles.schema.json"
    },
    "items": {
      "type": "array",
      "description": "Items to be displayed in the menu of the app.",
      "items": {
        "$ref": "https://schemas.apps.smartmate.io/apps/items/item.schema.json"
      }
    }
  },
  "additionalProperties": false
}
