{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "uSyncSchemaGeneratorAppSettings",
  "type": "object",
  "properties": {
    "USync": {
      "$ref": "#/definitions/USyncSchemaGeneratoruSyncDefinition"
    }
  },
  "definitions": {
    "USyncSchemaGeneratoruSyncDefinition": {
      "type": "object",
      "description": "Configuration of uSync settings",
      "properties": {
        "Settings": {
          "description": "uSync settings",
          "oneOf": [
            {
              "$ref": "#/definitions/USyncBackOfficeConfigurationuSyncSettings"
            }
          ]
        },
        "ForceFips": {
          "type": "boolean",
          "description": "Force uSync to use FIPS compliant hashing algorthims when comparing files"
        },
        "Sets": {
          "description": "Settings of Handler sets",
          "oneOf": [
            {
              "$ref": "#/definitions/USyncSchemaGeneratoruSyncSetsDefinition"
            }
          ]
        },
        "AutoTemplates": {
          "description": "Settings for the AutoTemplates package, (dynamic adding of templates based on files on disk)",
          "oneOf": [
            {
              "$ref": "#/definitions/USyncSchemaGeneratorAutoTemplatesDefinition"
            }
          ]
        }
      }
    },
    "USyncBackOfficeConfigurationuSyncSettings": {
      "type": "object",
      "description": "uSync Settings",
      "properties": {
        "RootFolder": {
          "type": "string",
          "description": "Location where all uSync files are saved by default",
          "default": "uSync/v9/"
        },
        "DefaultSet": {
          "type": "string",
          "description": "The default handler set to use on all notification triggered events",
          "default": "Default"
        },
        "ImportAtStartup": {
          "type": "string",
          "description": "Import when Umbraco boots (can be group name or 'All' so everything is done, blank or 'none' == off)",
          "default": "None"
        },
        "ExportAtStartup": {
          "type": "string",
          "description": "Export when Umbraco boots",
          "default": "None"
        },
        "ExportOnSave": {
          "type": "string",
          "description": "Export when an item is saved in Umbraco",
          "default": "All"
        },
        "UiEnabledGroups": {
          "type": "string",
          "description": "The handler groups that are enabled in the UI.",
          "default": "All"
        },
        "ReportDebug": {
          "type": "boolean",
          "description": "Debug reports (creates an export into a temp folder for comparison)",
          "default": false
        },
        "AddOnPing": {
          "type": "boolean",
          "description": "Ping the AddOnUrl to get the json used to show the addons dashboard",
          "default": true
        },
        "RebuildCacheOnCompletion": {
          "type": "boolean",
          "description": "Pre Umbraco 8.4 - rebuild the cache was needed after content was imported",
          "default": false
        },
        "FailOnMissingParent": {
          "type": "boolean",
          "description": "Fail if the items parent is not in umbraco or part of the batch being imported",
          "default": false
        },
        "CacheFolderKeys": {
          "type": "boolean",
          "description": "Should folder keys be cached (for speed)",
          "default": true
        },
        "ShowVersionCheckWarning": {
          "type": "boolean",
          "description": "Show a version check warning to the user if the folder version is less than the version expected by uSync.",
          "default": true
        },
        "CustomMappings": {
          "type": "object",
          "description": "Custom mapping keys, allows users to add a simple config mapping to make one property type to behave like an existing one",
          "additionalProperties": {
            "type": "string"
          }
        },
        "SignalRRoot": {
          "type": "string",
          "description": "location of SignalR hub script",
          "default": ""
        },
        "EnableHistory": {
          "type": "boolean",
          "description": "Should the history view be on of off ? ",
          "default": true
        },
        "DefaultExtension": {
          "type": "string",
          "description": "Default file extension for the uSync files. ",
          "default": "config"
        },
        "ImportOnFirstBoot": {
          "type": "boolean",
          "description": "Import the uSync folder on the first boot. ",
          "default": false
        },
        "FirstBootGroup": {
          "type": "string",
          "description": "Handler group(s) to run on first boot, default is All (so full import)",
          "default": "All"
        }
      }
    },
    "USyncSchemaGeneratoruSyncSetsDefinition": {
      "type": "object",
      "properties": {
        "Default": {
          "$ref": "#/definitions/USyncBackOfficeConfigurationuSyncHandlerSetSettings"
        }
      }
    },
    "USyncBackOfficeConfigurationuSyncHandlerSetSettings": {
      "type": "object",
      "description": "Settings for a handler set (group of handlers)",
      "properties": {
        "Enabled": {
          "type": "boolean",
          "description": "Is this handler set enabled",
          "default": true
        },
        "HandlerGroups": {
          "type": "array",
          "description": "List of groups handlers can belong to.",
          "items": {
            "type": "string"
          }
        },
        "DisabledHandlers": {
          "type": "array",
          "description": "List of disabled handlers",
          "items": {
            "type": "string"
          }
        },
        "HandlerDefaults": {
          "description": "Default settings for all handlers",
          "oneOf": [
            {
              "$ref": "#/definitions/USyncBackOfficeConfigurationHandlerSettings"
            }
          ]
        },
        "Handlers": {
          "type": "object",
          "description": "Settings for named handlers ",
          "additionalProperties": {
            "$ref": "#/definitions/USyncBackOfficeConfigurationHandlerSettings"
          }
        },
        "IsSelectable": {
          "type": "boolean",
          "description": "for handlers to appear in the drop down on the dashboard they have to be selectable\n            "
        }
      }
    },
    "USyncBackOfficeConfigurationHandlerSettings": {
      "type": "object",
      "description": "Settings to control who a handler works",
      "properties": {
        "Enabled": {
          "type": "boolean",
          "description": "Is handler enabled or disabled",
          "default": true
        },
        "Actions": {
          "type": "array",
          "description": "List of actions the handler is configured for. ",
          "items": {
            "type": "string"
          }
        },
        "UseFlatStructure": {
          "type": "boolean",
          "description": "Should use a flat folder structure when exporting items",
          "default": true
        },
        "GuidNames": {
          "type": "boolean",
          "description": "Items should be saved with their guid/key value as the filename",
          "default": false
        },
        "FailOnMissingParent": {
          "type": "boolean",
          "description": "Imports should fail if the parent item is missing (if false, item be importated go a close as possible to location)",
          "default": false
        },
        "Group": {
          "type": "string",
          "description": "Override the group the handler belongs too.",
          "default": ""
        },
        "Settings": {
          "type": "object",
          "description": "Additional settings for the handler",
          "additionalProperties": {
            "type": "string"
          }
        }
      }
    },
    "USyncSchemaGeneratorAutoTemplatesDefinition": {
      "type": "object",
      "properties": {
        "Enabled": {
          "type": "boolean",
          "description": "Enable AutoTemplates feature",
          "default": false
        },
        "Delete": {
          "type": "boolean",
          "description": "Delete templates from Umbraco if the file is missing from disk",
          "default": false
        },
        "Delay": {
          "type": "integer",
          "description": "Amount of time (milliseconds) to wait after file change event before applying changes",
          "format": "int32",
          "default": 1000
        }
      }
    }
  }
}