{
  "$id": "https://json.schemastore.org/foundryvtt-base-package-manifest.json",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "definitions": {
    "Identifier": {
      "type": "string",
      "format": "regex",
      "pattern": "^[a-zA-Z0-9_-]+$",
      "examples": ["lib-wrapper", "dnd5e"]
    },
    "File": {
      "type": "string",
      "description": "Relative path to a file, case sensitive.",
      "format": "uri-reference",
      "examples": ["src/main.mjs", "lang/en.json", "packs/loot.db"]
    },
    "FileArray": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/File"
      },
      "uniqueItems": true,
      "default": []
    },
    "URL": {
      "type": "string",
      "format": "uri",
      "pattern": "^https?://[^.\\s]+\\.[^.\\s]",
      "description": "A public URL.",
      "examples": [
        "https://example.com",
        "https://raw.githubusercontent.com/foundryvtt/worldbuilding/master/system.json"
      ]
    },
    "Version": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "number"
        }
      ],
      "examples": [
        "1.0.0",
        "0.5.0-beta",
        "1.0",
        "9.361",
        "2023-04-08",
        "20220312"
      ]
    },
    "NonBlankString": {
      "type": "string",
      "pattern": ".+"
    },
    "Flags": {
      "type": "object",
      "description": "Flag data."
    },
    "PackageCompatibility": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "minimum": {
          "description": "The module will not function for versions earlier than this.",
          "$ref": "#/definitions/Version"
        },
        "verified": {
          "description": "The module has been verified to be compatible up to this version.",
          "$ref": "#/definitions/Version"
        },
        "maximum": {
          "description": "The module will not function for newer versions than this.",
          "$ref": "#/definitions/Version"
        }
      }
    },
    "PackageRelationship": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "id": {
          "description": "Dependency entries require the id attribute. If only an id is provided, additional details about the module will be discovered from the Foundry VTT website listing.",
          "$ref": "#/definitions/Identifier"
        },
        "type": {
          "description": "The type attribute instructs FoundryVTT that the dependency may be on a different type of package. By default dependencies are assumed to be a module, so if you want to depend on a system or world you should be explicit.",
          "type": "string",
          "default": "module",
          "enum": ["module", "system", "world"]
        },
        "manifest": {
          "description": "The manifest attribute provides an explicit manifest url to be used for downloading the dependency. If a manifest is not provided, the dependency package must exist in the Foundry website directory.",
          "$ref": "#/definitions/URL"
        },
        "compatibility": {
          "description": "As above, the compatibility of a dependency can be defined, ensuring that the dependency will not be installed if it does not meet the defined requirements.",
          "$ref": "#/definitions/PackageCompatibility"
        },
        "reason": {
          "description": "(undocumented, intended to be used by core Foundry in the future)",
          "$ref": "#/definitions/NonBlankString"
        },
        "flags": {
          "$ref": "#/definitions/Flags"
        }
      },
      "required": ["id"]
    }
  },
  "properties": {
    "id": {
      "description": "Choose a unique package identifier. This must be an all lower-case string with no special characters and should use hyphens (not underscores) to separate multiple terms. This name must match exactly with the name of the parent directory within which you create the package.",
      "$ref": "#/definitions/Identifier"
    },
    "name": {
      "deprecated": true,
      "deprecationMessage": "Use id instead. Deprecated since V10.",
      "$ref": "#/definitions/Identifier"
    },
    "title": {
      "description": "Provide a human readable title for the package which is displayed as the visible name for the package in the Setup menu and elsewhere.",
      "$ref": "#/definitions/NonBlankString",
      "examples": ["Simple World-Building", "Unfulfilled Rolls"]
    },
    "description": {
      "description": "This field can contain a more lengthy description of the package. This text can be used to describe the functionality, list contact information, provide recommendations to contributors or testers, or any other information you feel is important to provide. This field can contain HTML to structure and style your text. For a system, this is also a good place to include any special licensing or attribution information that you need to distribute.",
      "type": "string",
      "examples": [
        "A minimalist game system which provides configurable Actor and Item templates to support free-form system agnostic game-play.",
        "<p>A module to integrate <a href=\"https://worldanvil.com\" title=\"World Anvil\" target=\"_blank\">World Anvil</a> with Foundry Virtual Tabletop.</p>"
      ]
    },
    "author": {
      "deprecated": true,
      "deprecationMessage": "Use authors instead. Deprecated since V10.",
      "$ref": "#/definitions/NonBlankString"
    },
    "authors": {
      "description": "An array listing each author as an object that contains a name and potentially some contact details.",
      "type": "array",
      "uniqueItems": true,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "description": "The only required field for an author.  This can be your username, your full name, etc.",
            "$ref": "#/definitions/NonBlankString"
          },
          "email": {
            "$ref": "#/definitions/NonBlankString",
            "examples": ["email@example.com"]
          },
          "url": {
            "$ref": "#/definitions/URL",
            "examples": ["https://website.com/of/the/author"]
          },
          "discord": {
            "type": "string",
            "pattern": "^.+#\\d+$|^[a-z0-9._]+$",
            "examples": ["oldDiscordID#0001", "new_2023_discord_id"]
          },
          "flags": {
            "$ref": "#/definitions/Flags"
          },
          "ko-fi": {
            "$ref": "#/definitions/NonBlankString",
            "description": "(Manifest+ field)",
            "examples": ["kofiName"]
          },
          "patreon": {
            "$ref": "#/definitions/NonBlankString",
            "description": "(Manifest+ field)",
            "examples": ["patreonName"]
          },
          "reddit": {
            "$ref": "#/definitions/NonBlankString",
            "description": "(Manifest+ field)",
            "examples": ["u/RedditUsername"]
          },
          "twitter": {
            "$ref": "#/definitions/NonBlankString",
            "description": "(Manifest+ field)",
            "examples": ["@TwitterHandle"]
          }
        },
        "required": ["name"]
      }
    },
    "url": {
      "description": "A public URL that links to the repository or documentation pages for the package. This link will be displayed for users to allow them to find more information about your package. If your package is hosted in version control like GitHub or GitLab, linking to the repository in this field is a good choice.",
      "$ref": "#/definitions/URL",
      "examples": [
        "https://github.com/foundryvtt/world-anvil",
        "https://gitlab.com/foundrynet/worldbuilding"
      ]
    },
    "license": {
      "description": "A path to a license file relative to the root package folder or a publicly accessible URL which contains the software license that applies to this package.",
      "examples": ["LICENSE.txt"],
      "anyOf": [
        {
          "$ref": "#/definitions/URL"
        },
        {
          "$ref": "#/definitions/File"
        }
      ]
    },
    "readme": {
      "description": "A path to a read-me file relative to the root package folder or a publicly accessible URL which contains instructions or information about the package.",
      "examples": [
        "https://gitlab.com/riccisi/foundryvtt-dice-so-nice/-/blob/master/README.md"
      ],
      "anyOf": [
        {
          "$ref": "#/definitions/URL"
        },
        {
          "$ref": "#/definitions/File"
        }
      ]
    },
    "bugs": {
      "description": "A publicly accessible URL where issues, suggestions, and bug reports may be filed.",
      "$ref": "#/definitions/URL",
      "examples": ["https://github.com/foundryvtt/pf2e/issues"]
    },
    "changelog": {
      "description": "A publicly accessible URL where update and release notes about the package may be found.",
      "$ref": "#/definitions/URL",
      "examples": [
        "https://github.com/shemetz/pf2e-modifiers-matter/blob/master/Changelog.md"
      ]
    },
    "flags": {
      "$ref": "#/definitions/Flags"
    },
    "media": {
      "type": "array",
      "description": "(undocumented, intended to be used by core Foundry in the future)",
      "items": {
        "type": "object",
        "properties": {
          "type": {
            "$ref": "#/definitions/NonBlankString"
          },
          "url": {
            "$ref": "#/definitions/URL"
          },
          "caption": {
            "$ref": "#/definitions/NonBlankString"
          },
          "loop": {
            "type": "boolean",
            "default": false
          },
          "thumbnail": {
            "$ref": "#/definitions/NonBlankString"
          },
          "flags": {
            "$ref": "#/definitions/Flags"
          }
        }
      }
    },
    "version": {
      "description": "The package version number can be a number or a string which denotes the version of your module/system/world. When making changes to your package, incrementing the version number in your manifest file is used to signal to users that an update is available. We discuss some supported options for versioning in the Introduction to Development article.",
      "$ref": "#/definitions/Version"
    },
    "compatibility": {
      "description": "The compatibility field is an object key for capturing the sub-fields which defines the limits of your package's compatibility based on Foundry Virtual Tabletop version.",
      "$ref": "#/definitions/PackageCompatibility"
    },
    "minimumCoreVersion": {
      "deprecated": true,
      "deprecationMessage": "Use compatibility.minimum instead. Deprecated since V10.",
      "$ref": "#/definitions/Version"
    },
    "compatibleCoreVersion": {
      "deprecated": true,
      "deprecationMessage": "Use compatibility.verified instead. Deprecated since V10.",
      "$ref": "#/definitions/Version"
    },
    "scripts": {
      "description": "A less common way of including Javascript with the increasing adoption of ESModules, this field allows you to define an array of JavaScript file paths which should be included whenever this package is being used. Each listed script path should be relative to the package root directory. All scripts which exist will be automatically included in the game session and loaded in their listed order.",
      "$ref": "#/definitions/FileArray"
    },
    "esmodules": {
      "description": "The preferred method for including Javascript with your project. This field allows you to define an array of JS files which use the newer ES6 modules specification. As with scripts, this should be declared as an array. These files are identified separately in the manifest so they may be correctly loaded as a module rather than a script.",
      "$ref": "#/definitions/FileArray"
    },
    "styles": {
      "description": "You can designate an array of CSS files which should be included in the game session whenever this package is used. Each listed stylesheet path should be relative to the package root directory. All stylesheets which exist will be automatically included in the game session and loaded in their listed order.",
      "$ref": "#/definitions/FileArray"
    },
    "languages": {
      "description": "A list of localization files that Foundry can use to translate strings.",
      "type": "array",
      "items": {
        "description": "The language definition",
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "lang": {
            "description": "A language code in lower-case letters, for example \"en\" for English. See https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes",
            "$ref": "#/definitions/NonBlankString",
            "examples": ["en", "fr", "de", "zh-tw"]
          },
          "name": {
            "description": "The formal and readable name for the language, for example \"English\".",
            "$ref": "#/definitions/NonBlankString",
            "examples": [
              "English",
              "Français",
              "Deutsch",
              "简体中文（Simplified Chinese）"
            ]
          },
          "path": {
            "description": "A path relative to the root directory of the manifest where localization strings are provided in JSON format.",
            "$ref": "#/definitions/File"
          },
          "system": {
            "description": "(undocumented)",
            "$ref": "#/definitions/Identifier"
          },
          "module": {
            "description": "(undocumented)",
            "$ref": "#/definitions/Identifier"
          },
          "flags": {
            "$ref": "#/definitions/Flags"
          }
        },
        "required": ["lang", "path"]
      }
    },
    "packs": {
      "description": "Packages may come bundled with Compendium packs which include game content for various Document types. Compendium packs are defined as objects which have their own internal metadata structure.",
      "type": "array",
      "items": {
        "description": "The definition of a Compendium pack.",
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "description": "Name of the Compendium pack. This should be a lowercase string with no special characters other than hyphens.",
            "$ref": "#/definitions/Identifier",
            "examples": ["abomination-vaults-bestiary", "fxmaster"]
          },
          "label": {
            "description": "Human readable label of the Compendium pack. This is displayed in the Compendium sidebar.",
            "$ref": "#/definitions/NonBlankString",
            "examples": ["TokenMagic Portfolio", "Premade Items"]
          },
          "path": {
            "description": "The relative path to the Compendium .db file. Best practice is to put these in the /packs subdirectory. Required until V11; afterwards, can be omitted if pack resides in `package-id/packs/`.",
            "$ref": "#/definitions/File"
          },
          "private": {
            "description": "(undocumented, will hide pack from non-GMs)",
            "type": "boolean"
          },
          "type": {
            "description": "Each Compendium pack must designate which type of Entity it contains.",
            "type": "string",
            "enum": [
              "Actor",
              "Cards",
              "Adventure",
              "Item",
              "Journal",
              "JournalEntry",
              "Macro",
              "Playlist",
              "RollTable",
              "Table",
              "Scene"
            ]
          },
          "entity": {
            "deprecated": true,
            "deprecationMessage": "Use type instead. Deprecated since V9.",
            "type": "string"
          },
          "system": {
            "description": "The id of the system/s the Compendium pack is created for. This ensures Foundry knows this Compendium only works for that system. This may be a string or an array of strings. Important: Actor, Item, and Adventure compendium packs MUST define a system field.",
            "oneOf": [
              {
                "$ref": "#/definitions/Identifier"
              },
              {
                "type": "array",
                "items": {
                  "$ref": "#/definitions/Identifier"
                }
              }
            ]
          },
          "flags": {
            "$ref": "#/definitions/Flags"
          }
        },
        "required": ["name", "label", "path", "type"]
      }
    },
    "relationships": {
      "description": "Packages can require modules, systems, or worlds be installed to allow their use. If a package has been installed with dependencies, but its dependencies are missing, it cannot be enabled.",
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "systems": {
          "description": "Will only allow the package to activated within Worlds which are running one of these systems and with a compatible version.",
          "type": "array",
          "items": {
            "$ref": "#/definitions/PackageRelationship"
          }
        },
        "requires": {
          "description": "If a package has been installed with dependencies, but its dependencies are missing, it cannot be enabled.",
          "type": "array",
          "items": {
            "$ref": "#/definitions/PackageRelationship"
          }
        },
        "recommends": {
          "description": "(undocumented, intended to be used by core Foundry in the future)",
          "type": "array",
          "items": {
            "$ref": "#/definitions/PackageRelationship"
          }
        },
        "conflicts": {
          "description": "(undocumented, intended to be used by core Foundry in the future)",
          "type": "array",
          "items": {
            "$ref": "#/definitions/PackageRelationship"
          }
        }
      }
    },
    "dependencies": {
      "deprecated": true,
      "deprecationMessage": "Use relationships instead. Deprecated since V10.",
      "type": "array",
      "items": {
        "description": "The definition of a dependency package.",
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "description": "ID of the package this package depends on.",
            "$ref": "#/definitions/Identifier"
          },
          "name": {
            "description": "ID of the package this package depends on.",
            "$ref": "#/definitions/Identifier"
          },
          "type": {
            "description": "The type of dependency.",
            "type": "string",
            "default": "module",
            "enum": ["module", "system", "world"]
          },
          "manifest": {
            "description": "Provides an explicit URL to the dependency's manifest to be able to install the package. If not provided, Foundry will check the website package list.",
            "$ref": "#/definitions/URL"
          }
        }
      }
    },
    "system": {
      "deprecated": true,
      "deprecationMessage": "Use relationships instead. Deprecated since V10.",
      "type": "string"
    },
    "socket": {
      "description": "A package may request for a specialized socket namespace to be provided. If set to true, a socket event will be handled by the server with the name `system.${id}` (for a system) or `module.${id}` (for a module), and will transact a arbitrary data object by broadcasting that data to all connected clients. This allows the package to have a reserved channel for messaging events which are needed to coordinate actions across multiple connected clients.",
      "type": "boolean"
    },
    "manifest": {
      "description": "A stable URL that describes the latest release version of your manifest file. This URL is used for automatic system installation in the Foundry VTT setup screen. This manifest URL is consulted during the system/module update check to see whether a new version is available for download. It is important that this address remain stable, otherwise updates will not be detected.",
      "$ref": "#/definitions/URL",
      "examples": [
        "https://raw.githubusercontent.com/foundryvtt/worldbuilding/master/system.json",
        "https://gitlab.com/tposney/dae/raw/master/package/module.json"
      ]
    },
    "download": {
      "description": "A public URL that provides a zip archive of the package for the manifest version which points to it. The archive at this URL is retrieved during the installation or update process. If you are using version control for your package - it is recommended to manage download archives using the tags and releases features which are supported by most git repositories.",
      "$ref": "#/definitions/URL",
      "examples": [
        "https://github.com/foundryvtt/worldbuilding/archive/refs/tags/release-072.zip",
        "https://gitlab.com/tposney/dae/raw/master/package/dae-v0.10.32.zip",
        "https://gitlab.com/riccisi/foundryvtt-dice-so-nice/-/jobs/artifacts/4.6.7/raw/dist/dice-so-nice.zip?job=build"
      ]
    },
    "protected": {
      "description": "(undocumented, used for premium packages)",
      "type": "boolean",
      "default": false
    },
    "exclusive": {
      "description": "(undocumented)",
      "type": "boolean"
    },
    "persistentStorage": {
      "description": "(undocumented, intended to be used by core Foundry in the future)",
      "type": "boolean"
    },
    "documentTypes": {
      "description": "(intended to be used by core Foundry in the future, see Module Sub-Types article)",
      "type": "object"
    },
    "manifestPlusVersion": {
      "description": "(Manifest+ field)",
      "$ref": "#/definitions/Version",
      "examples": ["1.2.0"]
    },
    "includes": {
      "description": "(Manifest+ field)",
      "type": "array"
    },
    "deprecated": {
      "description": "(Manifest+ field)",
      "type": "object"
    },
    "conflicts": {
      "description": "(Manifest+ field)",
      "type": "object"
    }
  },
  "required": ["id", "title", "description", "version"],
  "title": "JSON schema for Foundry VTT manifest files - module.json, system.json, or world.json.  This is the base from which others inherit.",
  "type": "object"
}
