{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "additionalProperties": false,
  "id": "https://json.schemastore.org/openfin.json",
  "properties": {
    "appAssets": {
      "description": "Set this object to co-deploy native apps along with your app.",
      "type": "array",
      "items": {
        "additionalProperties": false,
        "required": ["alias", "src", "version"],
        "properties": {
          "alias": {
            "type": "string",
            "description": "Name of the asset. The name will be used in launchExternalProcess to launch the asset."
          },
          "args": {
            "type": "string",
            "description": "The default command line arguments for the aforementioned target."
          },
          "src": {
            "type": "string",
            "description": "URL to a zip file containing the package files (executables, dlls, etc…)."
          },
          "target": {
            "type": "string",
            "description": "Specifies default executable to launch. This option can be overridden in launchExternalProcess."
          },
          "version": {
            "type": "string",
            "description": "Version of the package. To force new updates, increment the version."
          }
        }
      }
    },
    "assets_url": {
      "type": "string",
      "description": "If an application specifies a valid \"assetsUrl\", then that \"assetsUrl\" will be used as the base portion of the URL instead of the OpenFin default, https://developer.openfin.co/release/."
    },
    "devtools_port": {
      "type": "number",
      "description": "You can access the Chromium development tools by navigating to the selected port, i.e.: http://localhost:9090."
    },
    "dialogSettings": {
      "description": "An optional object to customize the appearance of the RVM progress dialog.",
      "additionalProperties": false,
      "properties": {
        "bgColor": {
          "type": "number",
          "description": "Determines the color of the dialog. Color value is a decimal representation of a 32 bit number (A,R,G,B). For instance : FF00FF00 or 4278255360 is fully opaque green."
        },
        "logo": {
          "type": "string",
          "description": "Determines the logo or image in the progress dialog. The logo should be a semi-transparent PNG. 100×25 pixels."
        },
        "progressBarBgColor": {
          "type": "number",
          "description": "Determines the background color of the area where the progress bar is displayed."
        },
        "progressBarBorderColor": {
          "type": "number",
          "description": "Determines the border color of the progress bar."
        },
        "progressBarFillColor": {
          "type": "number",
          "description": "Determines the color of the progress bar."
        },
        "textColor": {
          "type": "number",
          "description": "Determines the color of the text displayed above the progress bar location."
        }
      }
    },
    "licenseKey": {
      "type": "string",
      "description": "A string used as a licensing identifier for each customer/contract (RVM 2.7+). The OpenFin team will generate this for your production app."
    },
    "runtime": {
      "description": "Determines which runtime version the app will use.",
      "additionalProperties": false,
      "required": ["version"],
      "properties": {
        "arguments": {
          "type": "string",
          "description": "Command line arguments to set when launching the runtime. The OpenFin Runtime supports Chromium command line switches e.g.: \"– –disable-accelerated-compositing – –enable-threaded-compositing\" for a complete list of values please refer to current Chromium switches."
        },
        "fallbackVersion": {
          "type": "string",
          "description": "The RVM will fallback to this version if it fails to retrieve the desired Runtime version, assuming this version is already installed. (RVM 2.8+)"
        },
        "forceLatest": {
          "type": "boolean",
          "description": "If true, forces the runtime to always get the latest runtime version before launching (prevents background installs)."
        },
        "version": {
          "type": "string",
          "oneOf": [
            {
              "pattern": "(\\d{1,3}\\.){3}\\d{1,3}"
            },
            {
              "enum": ["alpha", "beta", "canary", "stable", "staging"]
            }
          ],
          "description": "Specifies what version of the runtime the app should use. The value can either be a specific version or a release channel (e.g. alpha)."
        }
      }
    },
    "shortcut": {
      "description": "Settings for the app's desktop shortcut",
      "additionalProperties": false,
      "required": ["company", "icon", "name"],
      "properties": {
        "company": {
          "type": "string",
          "description": "Company name for the application shortcut."
        },
        "description": {
          "type": "string",
          "description": "A short description of the application shortcut. Will be shown when hovering over the shortcut icon."
        },
        "force": {
          "type": "boolean",
          "description": "If set to true, a desktop icon is always created on application start-up (even when user has deleted it). If set to false, a desktop icon is created on initial application launch but not created on subsequent application launches."
        },
        "icon": {
          "type": "string",
          "description": "Location for the icon image to be used when installing the application shortcut."
        },
        "name": {
          "type": "string",
          "description": "Name of the application to display with the shortcut."
        },
        "startMenuRootFolder": {
          "type": "string",
          "description": "Set this value with a folder path (e.g. foo/bar) and the RVM will create the start menu shortcut under RootFolder/Company/App."
        },
        "target": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": ["automatic-start-up", "desktop", "start-menu"]
          },
          "description": "Locations for where the application shortcut is added on the desktop owner's machine. Available options are \"desktop\", \"start-menu\" and \"automatic-start-up\". The default is start-menu and desktop."
        },
        "uninstall-shortcut": {
          "type": "boolean",
          "description": "Removes the Start menu uninstall shortcut."
        }
      }
    },
    "splashScreenImage": {
      "type": "string",
      "description": "You can specify an image to display while the runtime is loading. It takes any image file (including semi-transparent PNGs)."
    },
    "startup_app": {
      "description": "Specifies the application level configuration.",
      "additionalProperties": false,
      "required": ["name", "url", "uuid"],
      "properties": {
        "accelerator": {
          "description": "The name of this builder instance, which can be specified in the only/except property of a provisioner.",
          "additionalProperties": false,
          "properties": {
            "devtools": {
              "type": "boolean",
              "description": "If true, allows the Dev Tools to be opened with the keyboard shortcut: Ctrl+Shift+i.",
              "default": false
            },
            "reload": {
              "type": "boolean",
              "description": "If true, allows a window to reload with the keyboard shortcuts: Ctrl+r or F5.",
              "default": false
            },
            "reloadIgnoreCache": {
              "type": "boolean",
              "description": "If true, allows a window to reload while ignoring the cache with the keyboard shortcuts: Ctrl+Shift or Shift+F5.",
              "default": false
            },
            "zoom": {
              "type": "boolean",
              "description": "If true, enables the Zoom keyboard shortcuts: Ctrl+ (Zoom in), Ctrl- (Zoom out) and Ctrl+0 (Restore to 100%).",
              "default": false
            }
          }
        },
        "alwaysOnTop": {
          "type": "boolean",
          "description": "A flag to always position the window at the top of the window stack.",
          "default": false
        },
        "applicationIcon": {
          "type": "string",
          "description": "A URL for the icon to be shown in the window title bar."
        },
        "autoShow": {
          "type": "boolean",
          "description": "A flag to automatically show the Window when it is created.",
          "default": false
        },
        "childWindowAutoAuth": {
          "type": "boolean",
          "description": "Allow non API created child windows, such as window.open, to authenticate.",
          "default": true
        },
        "clearChildSubscriptionsOnReload": {
          "type": "boolean",
          "description": "Clear InterApplication subscriptions of all child windows when main window is reloaded.",
          "default": true
        },
        "contextMenu": {
          "type": "boolean",
          "description": "A flag to show the context menu when right-clicking on a window. Gives access to the Developer Console for the Window.",
          "default": true
        },
        "cornerRounding": {
          "description": "This defines and applies rounded corners for the window.",
          "additionalProperties": false,
          "properties": {
            "height": {
              "type": "number",
              "description": "This defines and applies rounded corners for the window."
            },
            "width": {
              "type": "number",
              "description": "This defines and applies rounded corners for the window."
            }
          }
        },
        "defaultCentered": {
          "type": "boolean",
          "description": "Specifies that the window will be positioned in the center of the primary monitor when loaded for the first time on a machine. When the window corresponding to that id is loaded again, the position from before the window was closed is used.",
          "default": false
        },
        "defaultHeight": {
          "type": "number",
          "description": "The default height of the window. Specifies the height of the window when loaded for the first time on a machine. When the window corresponding to that id is loaded again, the height is taken to be the last height of the window before it was closed.",
          "default": 500
        },
        "defaultLeft": {
          "type": "number",
          "description": "The default left position of the window. Specifies the position of the left of the window when loaded for the first time on a machine. When the window corresponding to that id is loaded again, the value of left is taken to be the last value before the window was closed.",
          "default": 10
        },
        "defaultTop": {
          "type": "number",
          "description": "The default top position of the window. Specifies the position of the top of the window when loaded for the first time on a machine. When the window corresponding to that id is loaded again, the value of top is taken to be the last value before the window was closed.",
          "default": 10
        },
        "defaultWidth": {
          "type": "number",
          "description": "The default width of the window. Specifies the width of the window when loaded for the first time on a machine. When the window corresponding to that id is loaded again, the width is taken to be the last width of the window before it was closed.",
          "default": 800
        },
        "description": {
          "type": "string",
          "description": "The name for the window which must be unique within the context of the invoking Application."
        },
        "frame": {
          "type": "boolean",
          "description": "A flag to show the frame.",
          "default": true
        },
        "icon": {
          "type": "string",
          "description": "A URL for the icon to be shown in the window title bar."
        },
        "maxHeight": {
          "type": "number",
          "description": "The maximum height of a window. Will default to the OS defined value if set to -1.",
          "default": -1
        },
        "maximizable": {
          "type": "boolean",
          "description": "A flag that lets the window be maximized.",
          "default": true
        },
        "maxWidth": {
          "type": "number",
          "description": "The maximum width of a window. Will default to the OS defined value if set to -1.",
          "default": -1
        },
        "minHeight": {
          "type": "number",
          "description": "The minimum height of a window."
        },
        "minWidth": {
          "type": "number",
          "description": "The minimum width of a window."
        },
        "name": {
          "type": "string",
          "description": "The name for the window which must be unique within the context of the invoking Application."
        },
        "nonPersistent": {
          "type": "boolean",
          "description": "A flag to configure the application as a non persistent. Runtime exits if there are no persistent apps running.",
          "default": false
        },
        "opacity": {
          "type": "number",
          "description": "A flag that specifies how transparent the window will be. This value is clamped between 0.0 and 1.0.",
          "default": 1
        },
        "permissions": {
          "type": "object",
          "description": "Enable secured APIs",
          "properties": {
            "ExternalWindow": {
              "type": "object",
              "properties": {
                "wrap": {
                  "type": "boolean"
                }
              }
            },
            "System": {
              "type": "object",
              "properties": {
                "downloadAsset": {
                  "type": "boolean"
                },
                "getAllExternalWindows": {
                  "type": "boolean"
                },
                "launchExternalProcess": {
                  "type": "boolean"
                },
                "readRegistryValue": {
                  "type": "boolean"
                },
                "terminateExternalProcess": {
                  "type": "boolean"
                }
              }
            }
          }
        },
        "preloadScripts": {
          "type": "array",
          "description": "An array of scripts to download and run before other scripts in the page.",
          "items": {
            "required": ["url"],
            "properties": {
              "url": {
                "type": "string",
                "description": "URL from which to fetch the script."
              }
            }
          }
        },
        "resizable": {
          "type": "boolean",
          "description": "A flag to drop to allow the user to resize the window.",
          "default": true
        },
        "resizeRegion": {
          "description": "Define the attributes of the window's resize region.",
          "additionalProperties": false,
          "properties": {
            "bottomRightCorner": {
              "type": "number",
              "description": "Defines a region in pixels of an additional square at the bottom right corner of a frameless window.",
              "default": 4
            },
            "size": {
              "type": "number",
              "description": "Defines a region in pixels that will respond to user mouse interaction for resizing a frameless window.",
              "default": 2
            }
          }
        },
        "saveWindowState": {
          "type": "boolean",
          "description": "A flag to cache the location of the window or not.",
          "default": true
        },
        "showTaskbarIcon": {
          "type": "boolean",
          "description": "A flag to show the Window's icon in the taskbar.",
          "default": true
        },
        "state": {
          "type": "string",
          "enum": ["maximized", "minimized", "normal"],
          "description": "A string that sets the window to be \"minimized\", \"maximized\", or \"normal\" on creation.",
          "default": "normal"
        },
        "taskbarIcon": {
          "type": "string",
          "description": "The URL of an icon to be shown on the desktop. Support formats: Portable Network Graphic (PNG); Size: 256 x 256."
        },
        "taskbarIconGroup": {
          "type": "string",
          "description": "Group your OpenFin apps in the Taskbar. v5.0+"
        },
        "url": {
          "type": "string",
          "description": "The URL of the window."
        },
        "uuid": {
          "type": "string",
          "description": "The UUID of the application, unique within the set of all other Applications running in OpenFin Runtime."
        },
        "waitForPageLoad": {
          "type": "boolean",
          "description": "When set to false, the page will render before the \"load\" event is fired on the window. Caution, when false you will see an initial empty white window.",
          "default": true
        }
      }
    },
    "supportInformation": {
      "description": "An optional object to customize error messages.",
      "additionalProperties": false,
      "required": ["company", "email", "product"],
      "properties": {
        "company": {
          "type": "string",
          "description": "Displays the company name in the title bar for the support error dialog that appears when an application fails to load."
        },
        "email": {
          "type": "string",
          "description": "Displays the email to contact in the support error dialog that appears when an application fails to load."
        },
        "enableErrorReporting": {
          "type": "boolean",
          "description": "To disable the error reporting feature, set this value to false.",
          "default": true
        },
        "forwardErrorReports": {
          "type": "boolean",
          "description": "When set to true, prompts end users with a dialog when a deployment error occurs from within the RVM and enables them send along log files from their machine. Error reports are delivered to your email address set in supportInformation.",
          "default": false
        },
        "product": {
          "type": "string",
          "description": "Displays the product name or application name in the support error dialog that appears when an application fails to load."
        }
      }
    }
  },
  "required": ["runtime", "shortcut", "startup_app"],
  "title": "JSON schema for OpenFin application configuration files"
}
