{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/scoop-manifest/latest.json",
  "title": "scoop app manifest schema",
  "x-lintel": {
    "source": "https://raw.githubusercontent.com/lukesampson/scoop/master/schema.json",
    "sourceSha256": "6c15a47b09dba92bcdee8b0dadbe2776339c699e3bf4db0eff0ef0a000f2496c",
    "fileMatch": [
      "**/bucket/**.json"
    ],
    "parsers": [
      "json"
    ]
  },
  "type": "object",
  "properties": {
    "$schema": {
      "type": "string",
      "format": "uri"
    },
    "_comment": {
      "description": "Deprecated. Use ## instead.",
      "$ref": "#/$defs/stringOrArrayOfStrings"
    },
    "##": {
      "description": "A comment.",
      "$ref": "#/$defs/stringOrArrayOfStrings"
    },
    "architecture": {
      "type": "object",
      "properties": {
        "32bit": {
          "$ref": "#/$defs/architecture"
        },
        "64bit": {
          "$ref": "#/$defs/architecture"
        },
        "arm64": {
          "$ref": "#/$defs/architecture"
        }
      },
      "additionalProperties": false
    },
    "autoupdate": {
      "$ref": "#/$defs/autoupdate"
    },
    "bin": {
      "$ref": "#/$defs/stringOrArrayOfStringsOrAnArrayOfArrayOfStrings"
    },
    "persist": {
      "$ref": "#/$defs/stringOrArrayOfStringsOrAnArrayOfArrayOfStrings"
    },
    "checkver": {
      "$ref": "#/$defs/checkver"
    },
    "cookie": {
      "description": "Undocumented: Found at <https://github.com/se35710/scoop-java/search?l=JSON&q=cookie>",
      "type": "object"
    },
    "depends": {
      "$ref": "#/$defs/stringOrArrayOfStrings"
    },
    "description": {
      "type": "string"
    },
    "env_add_path": {
      "$ref": "#/$defs/stringOrArrayOfStrings"
    },
    "env_set": {
      "type": "object"
    },
    "extract_dir": {
      "$ref": "#/$defs/stringOrArrayOfStrings"
    },
    "extract_to": {
      "$ref": "#/$defs/stringOrArrayOfStrings"
    },
    "hash": {
      "$ref": "#/$defs/hash"
    },
    "homepage": {
      "format": "uri",
      "type": "string"
    },
    "innosetup": {
      "description": "True if the installer InnoSetup based. Found in <https://github.com/ScoopInstaller/Main/search?l=JSON&q=innosetup>",
      "type": "boolean"
    },
    "installer": {
      "$ref": "#/$defs/installer"
    },
    "license": {
      "$ref": "#/$defs/license"
    },
    "notes": {
      "$ref": "#/$defs/stringOrArrayOfStrings"
    },
    "post_install": {
      "$ref": "#/$defs/stringOrArrayOfStrings"
    },
    "post_uninstall": {
      "$ref": "#/$defs/stringOrArrayOfStrings"
    },
    "pre_install": {
      "$ref": "#/$defs/stringOrArrayOfStrings"
    },
    "pre_uninstall": {
      "$ref": "#/$defs/stringOrArrayOfStrings"
    },
    "psmodule": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "shortcuts": {
      "$ref": "#/$defs/shortcutsArray"
    },
    "suggest": {
      "type": "object",
      "additionalProperties": false,
      "patternProperties": {
        "^(.*)$": {
          "$ref": "#/$defs/stringOrArrayOfStrings"
        }
      }
    },
    "uninstaller": {
      "$ref": "#/$defs/uninstaller"
    },
    "url": {
      "$ref": "#/$defs/uriOrArrayOfUris"
    },
    "version": {
      "pattern": "^[\\w\\.\\-+_]+$",
      "type": "string"
    }
  },
  "additionalProperties": false,
  "required": [
    "version",
    "homepage",
    "license"
  ],
  "$defs": {
    "hashPattern": {
      "pattern": "^([a-fA-F0-9]{64}|(sha1|sha256|sha512|md5):([a-fA-F0-9]{32}|[a-fA-F0-9]{40}|[a-fA-F0-9]{64}|[a-fA-F0-9]{128}))$",
      "type": "string"
    },
    "jsonPathPattern": {
      "pattern": "^\\$[.\\[].*$",
      "type": "string"
    },
    "hash": {
      "anyOf": [
        {
          "$ref": "#/$defs/hashPattern"
        },
        {
          "items": {
            "$ref": "#/$defs/hashPattern"
          },
          "minItems": 1,
          "type": "array",
          "uniqueItems": true
        }
      ]
    },
    "hashExtraction": {
      "type": "object",
      "properties": {
        "find": {
          "format": "regex",
          "type": "string",
          "description": "Same as 'regex'"
        },
        "regex": {
          "format": "regex",
          "type": "string"
        },
        "jp": {
          "$ref": "#/$defs/jsonPathPattern",
          "description": "Same as 'jsonpath'"
        },
        "jsonpath": {
          "$ref": "#/$defs/jsonPathPattern"
        },
        "xpath": {
          "type": "string"
        },
        "mode": {
          "enum": [
            "download",
            "extract",
            "json",
            "xpath",
            "rdf",
            "metalink",
            "fosshub",
            "sourceforge"
          ]
        },
        "type": {
          "enum": [
            "md5",
            "sha1",
            "sha256",
            "sha512"
          ],
          "description": "Deprecated, hash type is determined automatically"
        },
        "url": {
          "anyOf": [
            {
              "format": "uri",
              "type": "string"
            },
            {
              "pattern": "^(\\$url|\\$baseurl).[\\w0-9]+$",
              "type": "string"
            },
            {
              "pattern": "^.*(\\$url|\\$baseurl).*$",
              "type": "string"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "hashExtractionOrArrayOfHashExtractions": {
      "anyOf": [
        {
          "$ref": "#/$defs/hashExtraction"
        },
        {
          "items": {
            "$ref": "#/$defs/hashExtraction"
          },
          "minItems": 1,
          "type": "array",
          "uniqueItems": false
        }
      ]
    },
    "architecture": {
      "type": "object",
      "properties": {
        "bin": {
          "$ref": "#/$defs/stringOrArrayOfStringsOrAnArrayOfArrayOfStrings"
        },
        "checkver": {
          "$ref": "#/$defs/checkver"
        },
        "env_add_path": {
          "$ref": "#/$defs/stringOrArrayOfStrings"
        },
        "env_set": {
          "type": "object"
        },
        "extract_dir": {
          "$ref": "#/$defs/stringOrArrayOfStrings"
        },
        "hash": {
          "$ref": "#/$defs/hash"
        },
        "installer": {
          "$ref": "#/$defs/installer"
        },
        "post_install": {
          "$ref": "#/$defs/stringOrArrayOfStrings"
        },
        "post_uninstall": {
          "$ref": "#/$defs/stringOrArrayOfStrings"
        },
        "pre_install": {
          "$ref": "#/$defs/stringOrArrayOfStrings"
        },
        "pre_uninstall": {
          "$ref": "#/$defs/stringOrArrayOfStrings"
        },
        "shortcuts": {
          "$ref": "#/$defs/shortcutsArray"
        },
        "uninstaller": {
          "$ref": "#/$defs/uninstaller"
        },
        "url": {
          "$ref": "#/$defs/uriOrArrayOfUris"
        }
      },
      "additionalProperties": false
    },
    "arrayOfArrayOfStrings": {
      "items": {
        "items": {
          "type": "string"
        },
        "minItems": 1,
        "type": "array"
      },
      "minItems": 1,
      "type": "array"
    },
    "shortcutsArray": {
      "items": {
        "items": {
          "type": "string"
        },
        "minItems": 2,
        "maxItems": 4,
        "type": "array"
      },
      "minItems": 1,
      "type": "array"
    },
    "autoupdateArch": {
      "type": "object",
      "properties": {
        "bin": {
          "$ref": "#/$defs/stringOrArrayOfStringsOrAnArrayOfArrayOfStrings"
        },
        "env_add_path": {
          "$ref": "#/$defs/stringOrArrayOfStrings"
        },
        "env_set": {
          "type": "object"
        },
        "extract_dir": {
          "$ref": "#/$defs/stringOrArrayOfStrings"
        },
        "hash": {
          "$ref": "#/$defs/hashExtractionOrArrayOfHashExtractions"
        },
        "installer": {
          "type": "object",
          "properties": {
            "file": {
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        "shortcuts": {
          "$ref": "#/$defs/shortcutsArray"
        },
        "url": {
          "$ref": "#/$defs/autoupdateUriOrArrayOfAutoupdateUris"
        }
      },
      "additionalProperties": false
    },
    "autoupdate": {
      "type": "object",
      "properties": {
        "architecture": {
          "type": "object",
          "properties": {
            "32bit": {
              "$ref": "#/$defs/autoupdateArch"
            },
            "64bit": {
              "$ref": "#/$defs/autoupdateArch"
            },
            "arm64": {
              "$ref": "#/$defs/autoupdateArch"
            }
          },
          "additionalProperties": false
        },
        "bin": {
          "$ref": "#/$defs/stringOrArrayOfStringsOrAnArrayOfArrayOfStrings"
        },
        "env_add_path": {
          "$ref": "#/$defs/stringOrArrayOfStrings"
        },
        "env_set": {
          "type": "object"
        },
        "extract_dir": {
          "$ref": "#/$defs/stringOrArrayOfStrings"
        },
        "hash": {
          "$ref": "#/$defs/hashExtractionOrArrayOfHashExtractions"
        },
        "installer": {
          "type": "object",
          "properties": {
            "file": {
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        "license": {
          "$ref": "#/$defs/license"
        },
        "notes": {
          "$ref": "#/$defs/stringOrArrayOfStrings"
        },
        "persist": {
          "$ref": "#/$defs/stringOrArrayOfStringsOrAnArrayOfArrayOfStrings"
        },
        "psmodule": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        "shortcuts": {
          "$ref": "#/$defs/shortcutsArray"
        },
        "url": {
          "$ref": "#/$defs/autoupdateUriOrArrayOfAutoupdateUris"
        }
      },
      "additionalProperties": false
    },
    "checkver": {
      "anyOf": [
        {
          "format": "regex",
          "type": "string"
        },
        {
          "type": "object",
          "properties": {
            "github": {
              "format": "uri",
              "type": "string"
            },
            "re": {
              "format": "regex",
              "type": "string",
              "description": "Same as 'regex'"
            },
            "regex": {
              "format": "regex",
              "type": "string"
            },
            "url": {
              "format": "uri",
              "type": "string"
            },
            "jp": {
              "$ref": "#/$defs/jsonPathPattern",
              "description": "Same as 'jsonpath'"
            },
            "jsonpath": {
              "$ref": "#/$defs/jsonPathPattern"
            },
            "xpath": {
              "type": "string"
            },
            "reverse": {
              "description": "Reverse the order of regex matches",
              "type": "boolean"
            },
            "replace": {
              "description": "Allows rearrange the regexp matches",
              "type": "string"
            },
            "useragent": {
              "type": "string"
            },
            "script": {
              "$ref": "#/$defs/stringOrArrayOfStrings",
              "description": "Custom PowerShell script to retrieve application version using more complex approach."
            },
            "sourceforge": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "object",
                  "properties": {
                    "project": {
                      "type": "string"
                    },
                    "path": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              ]
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "installer": {
      "type": "object",
      "properties": {
        "_comment": {
          "description": "Undocumented: only used in scoop-extras/oraclejdk* and scoop-extras/appengine-go",
          "type": "string"
        },
        "args": {
          "$ref": "#/$defs/stringOrArrayOfStrings"
        },
        "file": {
          "type": "string"
        },
        "script": {
          "$ref": "#/$defs/stringOrArrayOfStrings"
        },
        "keep": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "stringOrArrayOfStrings": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "items": {
            "type": "string"
          },
          "minItems": 1,
          "type": "array"
        }
      ]
    },
    "stringOrArrayOfStringsOrAnArrayOfArrayOfStrings": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "items": {
            "$ref": "#/$defs/stringOrArrayOfStrings"
          },
          "minItems": 1,
          "type": "array"
        }
      ]
    },
    "uninstaller": {
      "properties": {
        "args": {
          "$ref": "#/$defs/stringOrArrayOfStrings"
        },
        "file": {
          "type": "string"
        },
        "script": {
          "$ref": "#/$defs/stringOrArrayOfStrings"
        }
      },
      "oneOf": [
        {
          "required": [
            "file"
          ]
        },
        {
          "required": [
            "script"
          ]
        }
      ],
      "type": "object"
    },
    "uriOrArrayOfUris": {
      "anyOf": [
        {
          "format": "uri",
          "not": {
            "pattern": "(\\$)"
          },
          "type": "string"
        },
        {
          "items": {
            "format": "uri",
            "not": {
              "pattern": "(\\$)"
            },
            "type": "string"
          },
          "minItems": 1,
          "type": "array",
          "uniqueItems": true
        }
      ]
    },
    "autoupdateUriOrArrayOfAutoupdateUris": {
      "anyOf": [
        {
          "format": "uri",
          "type": "string"
        },
        {
          "items": {
            "format": "uri",
            "type": "string"
          },
          "minItems": 1,
          "type": "array",
          "uniqueItems": true
        }
      ]
    },
    "licenseIdentifiers": {
      "type": "string",
      "description": "License identifier based on SPDX License List <https://spdx.org/licenses/>",
      "examples": [
        "Apache-2.0",
        "BSD-3-Clause",
        "Freeware",
        "GPL-2.0-only",
        "GPL-2.0-or-later",
        "GPL-3.0-only",
        "GPL-3.0-or-later",
        "ISC",
        "LGPL-2.0-only",
        "LGPL-2.0-or-later",
        "LGPL-2.1-only",
        "LGPL-2.1-or-later",
        "LGPL-3.0-only",
        "LGPL-3.0-or-later",
        "MIT",
        "MS-PL",
        "Proprietary",
        "Public Domain",
        "Shareware",
        "Unlicense"
      ]
    },
    "license": {
      "anyOf": [
        {
          "$ref": "#/$defs/licenseIdentifiers"
        },
        {
          "type": "object",
          "properties": {
            "url": {
              "format": "uri",
              "type": "string"
            },
            "identifier": {
              "$ref": "#/$defs/licenseIdentifiers"
            }
          },
          "required": [
            "identifier"
          ],
          "additionalProperties": false
        }
      ]
    }
  },
  "then": {
    "required": [
      "url"
    ]
  },
  "if": {
    "properties": {
      "architecture": {
        "properties": {
          "64bit": {
            "properties": {
              "url": false
            }
          },
          "32bit": {
            "properties": {
              "url": false
            }
          },
          "arm64": {
            "properties": {
              "url": false
            }
          }
        }
      }
    }
  }
}
