2024-05-05 17:10:20 +00:00
{
"$schema" : "https://json-schema.org/draft/2020-12/schema" ,
"$id" : "/schemas/manifest.json" ,
"title" : "JSON schema for Castopod Plugins's manifest.json files" ,
"description" : "The Castopod plugin manifest defines both metadata and behavior of a plugin" ,
"type" : "object" ,
"properties" : {
"name" : {
"description" : "The plugin name, including 'vendor-name/' prefix" ,
"type" : "string" ,
"pattern" : "^[a-z0-9]([_.-]?[a-z0-9]+)*/[a-z0-9]([_.-]?[a-z0-9]+)*$" ,
"examples" : [ "acme/hello-world" ]
} ,
"version" : {
"description" : "The plugin's semantic version. See https://semver.org/" ,
"type" : "string" ,
"pattern" : "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$" ,
"examples" : [ "1.0.0" ]
} ,
"description" : {
"description" : "This helps people discover your plugin as it's listed in repositories" ,
"type" : "string"
} ,
"authors" : {
"type" : "array" ,
"items" : {
"$ref" : "#/$defs/person"
}
} ,
"homepage" : {
"description" : "The URL to the plugin homepage" ,
"type" : "string" ,
"format" : "uri"
} ,
"license" : {
"description" : "You should specify a license for your plugin so that people know how they are permitted to use it, and any restrictions you're placing on it." ,
"default" : "UNLICENSED" ,
"anyOf" : [
{
"type" : "string"
} ,
{
"enum" : [
"AGPL-3.0-only" ,
"AGPL-3.0-or-later" ,
"Apache-2.0" ,
"BSL-1.0" ,
"GPL-3.0-only" ,
"GPL-3.0-or-later" ,
"LGPL-3.0-only" ,
"LGPL-3.0-or-later" ,
"MIT" ,
"MPL-2.0" ,
"Unlicense" ,
"UNLICENSED"
]
}
]
} ,
"private" : {
"type" : "boolean" ,
"description" : "If set to true, then repositories should refuse to publish it."
} ,
"keywords" : {
"description" : "This helps people discover your plugin as it's listed in repositories" ,
"type" : "array" ,
"items" : {
"anyOf" : [
{
"type" : "string"
} ,
{
"enum" : [
"accessibility" ,
"analytics" ,
"monetization" ,
"podcasting2" ,
"privacy" ,
2024-12-15 17:34:36 +00:00
"productivity" ,
2024-05-05 17:10:20 +00:00
"seo"
]
}
]
} ,
"uniqueItems" : true
} ,
2024-07-05 16:47:01 +00:00
"minCastopodVersion" : {
"description" : "The minimal version of Castopod for which the plugin is compatible with." ,
"type" : "string" ,
"pattern" : "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(\\.(0|[1-9]\\d*))?(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$" ,
"examples" : [ "2.0" ]
} ,
2024-05-05 17:10:20 +00:00
"hooks" : {
"description" : "The hooks used by the plugin." ,
"type" : "array" ,
"items" : {
2024-05-17 14:01:04 +00:00
"enum" : [
"rssBeforeChannel" ,
"rssAfterChannel" ,
"rssBeforeItem" ,
"rssAfterItem" ,
"siteHead"
]
2024-05-05 17:10:20 +00:00
} ,
"uniqueItems" : true
} ,
"settings" : {
"type" : "object" ,
"properties" : {
"general" : {
2024-06-08 20:37:11 +00:00
"$ref" : "#/$defs/fields"
2024-05-05 17:10:20 +00:00
} ,
"podcast" : {
2024-06-08 20:37:11 +00:00
"$ref" : "#/$defs/fields"
2024-05-05 17:10:20 +00:00
} ,
"episode" : {
2024-06-08 20:37:11 +00:00
"$ref" : "#/$defs/fields"
2024-05-05 17:10:20 +00:00
}
}
} ,
"files" : {
"description" : "List of files to include in your plugin package. If you include a folder in the array, all files inside it will also be included." ,
"type" : "array" ,
"items" : {
"type" : "string"
}
} ,
"repository" : {
"description" : "Specify the place where your plugin code lives. This is helpful for people who want to contribute." ,
"type" : [ "object" , "string" ] ,
"properties" : {
"type" : {
"type" : "string"
} ,
"url" : {
"type" : "string"
} ,
"directory" : {
"type" : "string"
}
}
}
} ,
"required" : [ "name" , "version" ] ,
"additionalProperties" : false ,
"$defs" : {
"person" : {
"description" : "A person who has been involved in creating or maintaining this plugin." ,
"type" : [ "object" , "string" ] ,
"required" : [ "name" ] ,
"properties" : {
"name" : {
"type" : "string"
} ,
"email" : {
"type" : "string" ,
"format" : "email"
} ,
"url" : {
"type" : "string" ,
"format" : "uri"
}
}
} ,
2024-06-08 20:37:11 +00:00
"fields" : {
2024-05-12 18:38:33 +00:00
"type" : "object" ,
2024-06-08 20:37:11 +00:00
"patternProperties" : {
"^[A-Za-z]+[\\w\\-\\:\\.]*$" : { "$ref" : "#/$defs/field" }
} ,
"additionalProperties" : false
2024-05-12 18:38:33 +00:00
} ,
"field" : {
2024-05-05 17:10:20 +00:00
"type" : "object" ,
"properties" : {
"type" : {
2024-05-12 18:38:33 +00:00
"enum" : [
"checkbox" ,
"datetime" ,
"email" ,
2024-12-15 17:34:36 +00:00
"group" ,
2024-12-17 15:06:08 +00:00
"html" ,
2024-05-12 18:38:33 +00:00
"markdown" ,
"number" ,
"radio-group" ,
2024-12-15 17:34:36 +00:00
"rss" ,
2024-05-12 18:38:33 +00:00
"select-multiple" ,
"select" ,
"text" ,
"textarea" ,
"toggler" ,
"url"
] ,
2024-05-05 17:10:20 +00:00
"default" : "text"
} ,
"label" : {
"type" : "string"
} ,
"hint" : {
"type" : "string"
} ,
"helper" : {
"type" : "string"
} ,
"optional" : {
"type" : "boolean"
2024-05-12 18:38:33 +00:00
} ,
2024-12-23 15:35:47 +00:00
"validationRules" : {
"anyOf" : [
{
"type" : "string"
} ,
{
"type" : "array" ,
"items" : {
"type" : "string"
}
}
]
2024-12-10 15:57:06 +00:00
} ,
"multiple" : {
"type" : "boolean"
2024-05-05 17:10:20 +00:00
}
} ,
2024-06-08 20:37:11 +00:00
"required" : [ "label" ] ,
2024-12-23 15:35:47 +00:00
"unevaluatedProperties" : false ,
2024-05-12 18:38:33 +00:00
"allOf" : [
2024-12-10 15:57:06 +00:00
{ "$ref" : "#/$defs/field-multiple-implies-options-is-required" } ,
2024-12-23 15:35:47 +00:00
{ "$ref" : "#/$defs/require-fields-for-group-type" } ,
{ "$ref" : "#/$defs/default-value-based-on-type" }
2024-05-12 18:38:33 +00:00
]
} ,
"option" : {
"type" : "object" ,
"properties" : {
"label" : {
"type" : "string"
} ,
2024-12-10 15:57:06 +00:00
"description" : {
2024-05-12 18:38:33 +00:00
"type" : "string"
}
} ,
2024-06-10 14:55:10 +00:00
"required" : [ "label" ] ,
2024-05-05 17:10:20 +00:00
"additionalProperties" : false
2024-05-12 18:38:33 +00:00
} ,
"field-multiple-implies-options-is-required" : {
2024-12-23 15:35:47 +00:00
"if" : {
"properties" : {
"type" : {
"enum" : [ "radio-group" , "select" , "select-multiple" ]
}
}
} ,
"then" : {
"properties" : {
"options" : {
"type" : "object" ,
"patternProperties" : {
"^[A-Za-z0-9]+[\\w\\-\\:\\.]*$" : { "$ref" : "#/$defs/option" }
} ,
"additionalProperties" : false
}
} ,
"required" : [ "options" ]
}
} ,
"require-fields-for-group-type" : {
"if" : {
"properties" : {
"type" : {
"const" : "group"
}
}
} ,
"then" : {
"properties" : {
"fields" : {
"type" : "object" ,
"patternProperties" : {
"^[A-Za-z]+[\\w\\-\\:\\.]*$" : { "$ref" : "#/$defs/field" }
} ,
"additionalProperties" : false
}
} ,
"required" : [ "fields" ]
}
} ,
"default-value-based-on-type" : {
"allOf" : [
2024-05-12 18:38:33 +00:00
{
2024-12-23 15:35:47 +00:00
"if" : {
2024-05-12 18:38:33 +00:00
"properties" : {
"type" : {
2024-12-23 15:35:47 +00:00
"enum" : [
"html" ,
"markdown" ,
"radio-group" ,
"rss" ,
"select" ,
"text" ,
"textarea"
2024-05-12 18:38:33 +00:00
]
}
2024-12-23 15:35:47 +00:00
}
} ,
"then" : {
"properties" : {
"defaultValue" : { "type" : "string" }
}
2024-05-12 18:38:33 +00:00
}
} ,
2024-12-10 15:57:06 +00:00
{
2024-12-23 15:35:47 +00:00
"if" : {
2024-12-10 15:57:06 +00:00
"properties" : {
"type" : {
2024-12-23 15:35:47 +00:00
"enum" : [ "checkbox" , "toggler" ]
2024-12-10 15:57:06 +00:00
}
2024-12-23 15:35:47 +00:00
}
} ,
"then" : {
"properties" : {
"defaultValue" : { "type" : "boolean" }
}
}
} ,
{
"if" : {
"properties" : {
"type" : {
"const" : "datetime"
}
}
} ,
"then" : {
"properties" : {
"defaultValue" : { "type" : "string" , "format" : "date-time" }
}
}
} ,
{
"if" : {
"properties" : {
"type" : {
"const" : "email"
}
}
} ,
"then" : {
"properties" : {
"defaultValue" : { "type" : "string" , "format" : "email" }
}
}
} ,
{
"if" : {
"properties" : {
"type" : {
"const" : "number"
}
}
} ,
"then" : {
"properties" : {
"defaultValue" : { "type" : "number" }
}
2024-12-10 15:57:06 +00:00
}
} ,
2024-12-23 15:35:47 +00:00
{
"if" : {
"properties" : {
"type" : {
"const" : "select-multiple"
}
}
} ,
"then" : {
"properties" : {
"defaultValue" : {
"type" : "array" ,
"items" : {
"type" : "string"
}
}
}
}
} ,
{
"if" : {
"properties" : {
"type" : {
"const" : "url"
}
}
} ,
"then" : {
"properties" : {
"defaultValue" : { "type" : "string" , "format" : "uri" }
}
}
}
2024-12-10 15:57:06 +00:00
]
2024-05-05 17:10:20 +00:00
}
}
}