{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "definitions": {
    "editor": {
      "description": "This describes details about the editor.",
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "view": {
          "type": "string",
          "description": "This is the full path to the HTML view for your property editor."
        },
        "hideLabel": {
          "type": "boolean",
          "description": "If set to true, this hides the label for the property editor when used on a document type."
        },
        "valueType": {
          "type": "string",
          "description": "This is the type of data you want your property editor to save to the database.",
          "enum": ["STRING", "JSON", "DATETIME", "TEXT", "INT"]
        },
        "validation": {
          "description": "Object describing required validators on the editor.",
          "type": "object"
        },
        "isReadOnly": {
          "type": "boolean",
          "description": "If set to true, this makes the property editor read-only.",
          "default": false
        },
        "supportsReadOnly": {
          "type": "boolean",
          "description": "If set to true, this will disable the default read-only overlay and requires the editor to implement support for this instead.",
          "default": false
        }
      }
    },
    "editors": {
      "type": "object",
      "required": ["name", "alias", "editor"],
      "properties": {
        "alias": {
          "type": "string",
          "description": "This must be a unique alias to your property editor."
        },
        "defaultConfig": {
          "type": "object",
          "description": "Provides a collection of default configuration values, in cases the property editor is not configured or is used a parameter editor, which doesn't allow configuration. The object is a key/value collection and must match the prevalue fields keys.",
          "minProperties": 1
        },
        "editor": {
          "$ref": "#/definitions/editor"
        },
        "isParameterEditor": {
          "type": "boolean",
          "description": "Enables the property editor as a macro parameter editor.",
          "default": false
        },
        "name": {
          "type": "string",
          "description": "The friendly name of the property editor, shown in the backoffice."
        },
        "icon": {
          "type": "string",
          "description": "A CSS class for the icon to be used in the 'Select Editor' dialog, e.g. `icon-autofill`."
        },
        "group": {
          "type": "string",
          "description": "The group to place this editor in within the 'Select Editor' dialog. Use a new group name or alternatively use an existing one such as `Pickers`."
        }
      }
    },
    "gridEditor": {
      "type": "object",
      "required": ["name", "alias", "view"],
      "properties": {
        "name": {
          "type": "string",
          "description": "The friendly name of the grid editor, shown in the backoffice."
        },
        "alias": {
          "type": "string",
          "description": "This must be a unique alias to your grid editor."
        },
        "icon": {
          "type": "string",
          "description": "A CSS class for the icon to be used in the 'Select Editor' dialog, e.g. `icon-autofill`."
        },
        "view": {
          "type": "string",
          "description": "This is backoffice HTML view for your grid editor. Either refers to one of the built-in view (textstring, rte, embed, macro, media) or the full path to a custom view, e.g. `~/App_Plugins/FolderName/editor.html`."
        },
        "render": {
          "type": "string",
          "description": "This is front end Razor view for your grid editor. Accepts full path to a custom view, e.g. `~/App_Plugins/FolderName/editor.cshtml`."
        },
        "config": {
          "type": "object",
          "description": "Configuration for the grid editor. Can be used with textstring and media views or for custom configuration properties.",
          "minProperties": 1,
          "properties": {
            "style": {
              "type": "string",
              "description": "If used with the textstring view, this accepts inline CSS to style the textstring box, e.g. `font-size: 30px; line-height: 40px; font-weight: bold;`."
            },
            "markup": {
              "type": "string",
              "description": "If used with the textstring view, this allows wrapping the value in custom markup, e.g. `<h2>#value#</h2>`."
            },
            "size": {
              "type": "object",
              "description": "If used with the media view, this accepts height and width key/value pairs for cropping.",
              "properties": {
                "height": {
                  "type": "integer",
                  "description": "Height of image in pixels."
                },
                "width": {
                  "type": "integer",
                  "description": "Width of image in pixels."
                }
              }
            }
          }
        }
      }
    },
    "preValues": {
      "type": "object",
      "properties": {
        "prevalues": {
          "type": "object",
          "description": "This is an object that stores an array of prevalue fields or options to configure your property editor.",
          "properties": {
            "fields": {
              "$ref": "#/definitions/fields"
            }
          }
        }
      }
    },
    "fields": {
      "type": "array",
      "description": "This is the collection of prevalue fields.",
      "minItems": 1,
      "items": {
        "type": "object",
        "minProperties": 1,
        "properties": {
          "key": {
            "type": "string",
            "description": "A unique key for the prevalue field.",
            "minLength": 1
          },
          "label": {
            "type": "string",
            "description": "The user friendly label for the prevalue."
          },
          "description": {
            "type": "string",
            "description": "A more detailed description for the user."
          },
          "view": {
            "type": "string",
            "description": "The type of editor to use for this prevalue field."
          },
          "validation": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "dashboard": {
      "description": "A dashboard to display contextual information when in a section/application.",
      "type": "object",
      "additionalProperties": false,
      "required": ["alias", "view", "sections"],
      "properties": {
        "alias": {
          "type": "string",
          "description": "The alias of the dashboard which can be queried via the Dashboard Service API.",
          "minLength": 1
        },
        "view": {
          "type": "string",
          "description": "This is the full path to the HTML view for your dashboard.",
          "minLength": 1
        },
        "sections": {
          "type": "array",
          "description": "A list of section/application aliases that the dashboard should be visible in.",
          "uniqueItems": true,
          "minItems": 1,
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "weight": {
          "type": "integer",
          "description": "The weight (sort order) of the dashboard. Defaults to 100 if not specified."
        },
        "access": {
          "type": "array",
          "description": "A list of what user groups aliases are granted or denied permission to see the dashboard. All users will have access if not specified.",
          "uniqueItems": true,
          "minItems": 1,
          "items": {
            "type": "object",
            "properties": {
              "deny": {
                "type": "string",
                "description": "A user group alias who is denied access."
              },
              "grant": {
                "type": "string",
                "description": "A user group alias who is granted access."
              }
            },
            "oneOf": [
              {
                "required": ["deny"]
              },
              {
                "required": ["grant"]
              }
            ]
          }
        }
      }
    },
    "section": {
      "description": "A section/application to extend the backoffice.",
      "type": "object",
      "additionalProperties": false,
      "required": ["name", "alias"],
      "properties": {
        "name": {
          "type": "string",
          "description": "The friendly name of the section/application, shown in the backoffice.",
          "minLength": 1
        },
        "alias": {
          "type": "string",
          "description": "The alias of the section/application which can be queried via the Section Service API.",
          "minLength": 1
        }
      }
    },
    "contentApp": {
      "description": "A section/application to extend the backoffice.",
      "type": "object",
      "additionalProperties": false,
      "required": ["name", "alias", "icon", "view"],
      "properties": {
        "name": {
          "type": "string",
          "description": "The friendly name of the content app that appears under the icon.",
          "minLength": 1
        },
        "alias": {
          "type": "string",
          "description": "A unique alias of the content app.",
          "minLength": 1
        },
        "icon": {
          "type": "string",
          "description": "A CSS class for the icon to be used for the content app, e.g. `icon-calculator`."
        },
        "view": {
          "type": "string",
          "description": "This is the full path to the HTML view for your content app."
        },
        "weight": {
          "type": "integer",
          "description": "The weight (sort order) of the content app. Default is 0, use values between -99 and +99 to appear between the existing Content (-100) and Info (100) apps."
        },
        "show": {
          "type": "array",
          "description": "A list of rules to show or hide the content app based on content, media and member types.",
          "uniqueItems": true,
          "items": {
            "type": "string",
            "description": "See documentation for examples of rules: https://our.umbraco.com/Documentation/Extending/Content-Apps/#limiting-according-to-type."
          }
        }
      }
    }
  },
  "id": "https://json.schemastore.org/package.manifest.json",
  "properties": {
    "id": {
      "type": "string",
      "description": "The (NuGet) package ID, shown in the backoffice and included in package telemetry as unique identifier (supported in v12+). Also used to retrieve the assembly informational version if no explicit `version` and `versionAssemlbyName` is set."
    },
    "name": {
      "type": "string",
      "description": "The (friendly) package name, shown in the backoffice and included in package telemetry. If not specified, uses the directory name instead."
    },
    "version": {
      "type": "string",
      "description": "The package version, shown in the backoffice and included in package telemetry. If not specified, uses the `versionAssemblyName` or `id` to retrieve the assembly informational version."
    },
    "versionAssemblyName": {
      "type": "string",
      "description": "The assembly name to retrieve the informational version, if no explicit `version` is set. If not specified, uses the `id` instead (supported in v12+)."
    },
    "allowPackageTelemetry": {
      "type": "boolean",
      "description": "Allows you to opt-out of including your package in telemetry reports if set to false, defaults to true.",
      "default": true
    },
    "packageView": {
      "type": "string",
      "description": "The full path to an HTML view for your package to help users maintain configuration data when viewing installed packages in the backoffice.",
      "minLength": 1
    },
    "bundleOptions": {
      "type": "string",
      "description": "Default: The assets will be bundled with the typical packages bundle. None: The assets in the package will not be processed at all and will all be requested as individual assets in debug and production. Independent: The packages assets will be processed as it's own separate bundle (in debug, files will not be processed).",
      "enum": ["Default", "None", "Independent"]
    },
    "javascript": {
      "type": "array",
      "description": "A list of JavaScript files with full path to load in the backoffice.",
      "uniqueItems": true,
      "items": {
        "type": "string"
      }
    },
    "css": {
      "type": "array",
      "description": "A list of CSS files with full path to load in the backoffice.",
      "uniqueItems": true,
      "items": {
        "type": "string"
      }
    },
    "propertyEditors": {
      "type": "array",
      "description": "Returns an array of editor objects, each object specifies an editor to make available to data types as an editor component. These editors are primarily property editors for content, media and members, but can also be made available as a macro parameter editor.",
      "minItems": 1,
      "items": {
        "allOf": [
          {
            "$ref": "#/definitions/editors"
          },
          {
            "$ref": "#/definitions/preValues"
          }
        ]
      }
    },
    "parameterEditors": {
      "type": "array",
      "description": "Returns an array of editor objects, each object specifies an editor to make available to macro parameters as an editor component. These editors work solely as parameter editors, and will not show up on the property editors list.",
      "minItems": 1,
      "items": {
        "$ref": "#/definitions/editors"
      }
    },
    "gridEditors": {
      "type": "array",
      "description": "Returns an array of grid editor objects, each object specifies a grid editor to make available in the Grid Layout property editor.",
      "minItems": 1,
      "items": {
        "$ref": "#/definitions/gridEditor"
      }
    },
    "dashboards": {
      "type": "array",
      "description": "Returns an array of dashboards, each object specified a dashboard to make available in the backoffice.",
      "uniqueItems": true,
      "minItems": 1,
      "items": {
        "$ref": "#/definitions/dashboard"
      }
    },
    "sections": {
      "type": "array",
      "description": "Returns an array of sections/applications to add to the backoffice.",
      "uniqueItems": true,
      "minItems": 1,
      "items": {
        "$ref": "#/definitions/section"
      }
    },
    "contentApps": {
      "type": "array",
      "description": "Returns an array of Content Apps to add to the backoffice.",
      "uniqueItems": true,
      "minItems": 1,
      "items": {
        "$ref": "#/definitions/contentApp"
      }
    }
  },
  "title": "JSON schema for Umbraco package.manifest files.",
  "type": "object"
}
