{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://json.schemastore.org/datalogic-scan2deploy-ce.json",
  "definitions": {},
  "description": "Schema to validate Windows CE JSON files given as input to DL-Config to generate Scan2Deploy barcodes",
  "properties": {
    "layout": {
      "$id": "#/properties/layout",
      "type": "object",
      "title": "Layout Schema",
      "properties": {
        "description": {
          "$id": "#/properties/layout/properties/description",
          "type": "string",
          "title": "Description Schema",
          "default": "none",
          "examples": ["This is for our WEC7 devices"],
          "maxLength": 350
        }
      }
    },
    "global": {
      "$id": "#/properties/global",
      "type": "object",
      "title": "Global-Section Schema",
      "description": "Section used to configure application scoped settings",
      "properties": {
        "target-path": {
          "$id": "#/properties/global/properties/target-path",
          "type": "string",
          "title": "Target-Path Schema",
          "description": "Base destination folder where archive/folder will be inflated",
          "default": "\\FlashDisk",
          "examples": ["\\FlashDisk"]
        },
        "action": {
          "$id": "#/properties/global/properties/action",
          "type": "string",
          "enum": ["stay", "close", "warm-boot", "cold-boot", "clean-boot"],
          "title": "Action Schema",
          "description": "Specifies final action performed by the application at the end of the staging process",
          "default": "cold-boot",
          "examples": ["warm-boot"]
        },
        "ping-timeout": {
          "$id": "#/properties/global/properties/ping-timeout",
          "type": "integer",
          "title": "Ping-Timeout Schema",
          "description": "The timeout value used when attempting to reach the host server",
          "default": 1000,
          "examples": [1000],
          "minimum": 1,
          "maximum": 4000
        }
      }
    },
    "settings": {
      "$id": "#/properties/settings",
      "type": "object",
      "title": "Settings-Section Schema",
      "description": "Section used to configure inner device settings",
      "properties": {
        "usb-function": {
          "$id": "#/properties/settings/properties/usb-function",
          "type": "string",
          "enum": [
            "active-sync-usb",
            "active-sync-com",
            "usblan",
            "mass-storage"
          ],
          "title": "USB-Function Schema",
          "description": "USB communication function to use",
          "default": "active-sync-usb",
          "examples": ["usblan"]
        }
      }
    },
    "network": {
      "$id": "#/properties/network",
      "type": "object",
      "title": "Network-Section Schema",
      "description": "Section used to configure device Wi-Fi network",
      "properties": {
        "profile": {
          "$id": "#/properties/network/properties/profile",
          "type": "string",
          "title": "Profile Schema",
          "description": "\"Friendly\" name to associate with the network connection",
          "default": "datalogic",
          "examples": ["my_fast"]
        },
        "essid": {
          "$id": "#/properties/network/properties/essid",
          "type": "string",
          "title": "Essid Schema",
          "description": "Wireless network ESSID",
          "default": "tsunami",
          "examples": ["eapfast"]
        },
        "mode": {
          "$id": "#/properties/network/properties/mode",
          "type": "string",
          "enum": [
            "open",
            "wep-40",
            "wep-104",
            "wpa-psk",
            "wpa2-psk",
            "wpa-tkip",
            "wpa2-aes"
          ],
          "title": "Mode Schema",
          "description": "Wireless connection mode",
          "default": "open",
          "examples": ["wpa2-aes"]
        },
        "mode-key": {
          "$id": "#/properties/network/properties/mode-key",
          "type": "string",
          "title": "Mode-Key Schema",
          "description": "Wireless network key for 'wep-40', 'wep-104', 'wpa-psk', and 'wpa2-psk' networks",
          "default": "",
          "examples": ["0123456789"],
          "minLength": 5,
          "maxLength": 63
        },
        "index": {
          "$id": "#/properties/network/properties/index",
          "type": "integer",
          "title": "Index Schema",
          "description": "Wireless network key index for 'wep-40' and 'wep-104' networks",
          "default": 1,
          "examples": [1],
          "minimum": 1,
          "maximum": 4
        },
        "eap-method": {
          "$id": "#/properties/network/properties/eap-method",
          "type": "string",
          "enum": ["none", "peap", "tls", "ttls", "fast", "leap"],
          "title": "Eap-Method Schema",
          "description": "Configures the EAP authentication method",
          "default": "none",
          "examples": ["fast"]
        },
        "eap-username": {
          "$id": "#/properties/network/properties/eap-username",
          "type": "string",
          "title": "Eap-Username Schema",
          "description": "Username for the EAP method",
          "default": "",
          "examples": ["eapfast"]
        },
        "eap-password": {
          "$id": "#/properties/network/properties/eap-password",
          "type": "string",
          "title": "Eap-Password Schema",
          "description": "Password for EAP method",
          "default": "",
          "examples": ["1234567890"]
        },
        "credentials-type": {
          "$id": "#/properties/network/properties/credentials-type",
          "type": "string",
          "enum": ["password", "token", "certificate", "unknown"],
          "title": "Credentials-Type Schema",
          "description": "Indicates the EAP credentials type",
          "default": "password",
          "examples": ["password"]
        },
        "credentials-source": {
          "$id": "#/properties/network/properties/credentials-source",
          "type": "string",
          "enum": ["user", "logon", "profile", "auto", "unknown"],
          "title": "Credentials-Source Schema",
          "description": "Indicates the EAP credentials source",
          "default": "user",
          "examples": ["profile"]
        },
        "validate-server": {
          "$id": "#/properties/network/properties/validate-server",
          "type": "boolean",
          "title": "Validate-Server Schema",
          "description": "Indicates if the server certificate should be validated",
          "default": false,
          "examples": [false]
        },
        "connect-to-server": {
          "$id": "#/properties/network/properties/connect-to-server",
          "type": "boolean",
          "title": "Connect-To-Server Schema",
          "description": "Indicates if only the servers listed in the 'connect-to-server-names' list should be connected to",
          "default": false,
          "examples": [false]
        },
        "connect-to-server-names": {
          "$id": "#/properties/network/properties/connect-to-server-names",
          "type": "string",
          "title": "Connect-To-Server-Names Schema",
          "description": "Semi-colon separated list of servers that are valid to connect to during server certificate validation",
          "default": "",
          "examples": [""]
        },
        "server-cert-name": {
          "$id": "#/properties/network/properties/server-cert-name",
          "type": "string",
          "title": "Server-Cert-Name Schema",
          "description": "\"Friendly\" name of the server digital certificate that should be validated",
          "default": "",
          "examples": [""]
        },
        "outer-identity": {
          "$id": "#/properties/network/properties/outer-identity",
          "type": "string",
          "title": "Outer-Identity Schema",
          "description": "The outer-identity of the EAP method",
          "default": "",
          "examples": [""]
        },
        "fast-reconnect": {
          "$id": "#/properties/network/properties/fast-reconnect",
          "type": "boolean",
          "title": "Fast-Reconnect Schema",
          "description": "Indicate if fast reconnect should be enabled",
          "default": false,
          "examples": [false]
        },
        "inner-method": {
          "$id": "#/properties/network/properties/inner-method",
          "type": "string",
          "enum": ["eap-tls", "eap-MsChapV2", "eap-gtc"],
          "title": "Inner-Method Schema",
          "description": "Inner EAP authentication method to use",
          "default": "eap-tls",
          "examples": ["eap-MsChapV2"]
        },
        "auto-pac": {
          "$id": "#/properties/network/properties/auto-pac",
          "type": "boolean",
          "title": "Auto-Pac Schema",
          "description": "Indicates if automatic PAC provisioning is used for an EAP-FAST network",
          "default": false,
          "examples": [true]
        },
        "pac-file-path": {
          "$id": "#/properties/network/properties/pac-file-path",
          "type": "string",
          "title": "Pac-File-Path Schema",
          "description": "Full path to the PAC file for manual PAC provisioning",
          "default": "",
          "examples": [""]
        },
        "pac-aid-info": {
          "$id": "#/properties/network/properties/pac-aid-info",
          "type": "string",
          "title": "Pac-Aid-Info Schema",
          "description": "PAC authority identity (AID) information used to select PAC from a list of PACs on the device",
          "default": "",
          "examples": [""]
        }
      },
      "if": {
        "properties": {
          "mode": {
            "enum": ["wpa-psk", "wpa2-psk", "wep-40", "wep-104"]
          }
        }
      },
      "then": {
        "required": ["mode-key"]
      }
    },
    "deployment": {
      "$id": "#/properties/deployment",
      "type": "object",
      "title": "Deployment-Section Schema",
      "description": "Section used to download a ZIP archive from a server and inflate it to the 'target-path' folder",
      "properties": {
        "scheme": {
          "$id": "#/properties/deployment/properties/scheme",
          "type": "string",
          "enum": ["http", "https"],
          "title": "Scheme Schema",
          "description": "Deployment download scheme to use",
          "default": "http",
          "examples": ["http"]
        },
        "host": {
          "$id": "#/properties/deployment/properties/host",
          "type": "string",
          "title": "Host Schema",
          "description": "Host name or internet protocol address of the server from which the resource is to be fetched",
          "default": "",
          "examples": ["10.1.20.123"]
        },
        "port": {
          "$id": "#/properties/deployment/properties/port",
          "type": "integer",
          "title": "Port Schema",
          "description": "TCP/IP port to be used to contact the server",
          "default": 80,
          "examples": [8080],
          "minimum": 0,
          "maximum": 65535
        },
        "path": {
          "$id": "#/properties/deployment/properties/path",
          "type": "string",
          "title": "Path Schema",
          "description": "Path to server resource to download, complete with query string if needed",
          "default": "",
          "examples": ["target.zip"]
        }
      },
      "required": ["host"]
    },
    "shell": {
      "$id": "#/properties/shell",
      "type": "object",
      "title": "Shell-Section Schema",
      "description": "Section for executable shell commands to be performed in the final staging phase",
      "required": ["cmds"],
      "properties": {
        "cmds": {
          "$id": "#/properties/shell/properties/cmds",
          "type": "array",
          "title": "Cmds Schema",
          "description": "Each object in 'cmds' is a shell command to execute in the final phase of staging",
          "items": {
            "$id": "#/properties/shell/properties/cmds/items",
            "type": "object",
            "title": "Items Schema",
            "required": ["app-name"],
            "properties": {
              "app-name": {
                "$id": "#/properties/shell/properties/cmds/items/properties/app-name",
                "type": "string",
                "title": "App-Name Schema",
                "description": "Full path to the application to be executed",
                "default": "",
                "examples": ["\\windows\\dldxu.exe"]
              },
              "args": {
                "$id": "#/properties/shell/properties/cmds/items/properties/args",
                "type": "string",
                "title": "Args Schema",
                "description": "Command line arguments",
                "default": "",
                "examples": ["\\FlashDisk\\target\\config.dxu"]
              }
            }
          }
        }
      }
    }
  },
  "title": "CE-Scan2Deploy Schema",
  "type": "object"
}
