Files
effectcraft/examples/plugin-catalog/schema.json
T
dotCooCoo 36dc209bad Plug-in Library: release and repo URLs with white space are refused
Install and Preview, the catalog schema and scripts/validate.sh now refuse a release URL or repo folder that contains white space in any segment, the tag and file name included: any Unicode white space character, and U+FEFF. Before, the app accepted a space or tab in a tag, file name or repo folder that the schema refused.
2026-11-06 00:49:16 -08:00

55 lines
2.6 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://raw.githubusercontent.com/storytold/effectcraft-plugins/main/schema.json",
"title": "EffectCraft Plug-in Library catalog (index.json), format 1",
"description": "Mirrors crates/engine/src/system/library.rs (parse_catalog). Unknown fields are rejected here to catch typos; the app itself ignores them.",
"type": "object",
"required": ["schema", "packages"],
"additionalProperties": false,
"properties": {
"schema": {"const": 1},
"packages": {"type": "array", "maxItems": 10000, "items": {"$ref": "#/$defs/package"}}
},
"$defs": {
"version": {"type": "string", "maxLength": 32, "pattern": "^[0-9]+(\\.[0-9]+)*$"},
"release_url": {
"type": "string",
"pattern": "^(?!.*/(\\.|%2[eE]){1,2}(/|$))https://[Gg][Ii][Tt][Hh][Uu][Bb]\\.[Cc][Oo][Mm]/[A-Za-z0-9._-]+/[A-Za-z0-9._-]+/releases/download/[^/?#\\\\\\s\\u0085]+(/[^/?#\\\\\\s\\u0085]+)+$"
},
"package": {
"type": "object",
"required": ["id", "name", "versions"],
"additionalProperties": false,
"properties": {
"id": {"type": "string", "pattern": "^(?!\\.)(?!.*\\.\\.)(?!.*\\.$)[A-Za-z0-9._-]{1,100}$"},
"name": {"type": "string", "pattern": "\\S"},
"author": {"type": "string"},
"description": {"type": "string"},
"license": {"type": "string"},
"repo": {"type": "string", "pattern": "^(?!.*/(\\.|%2[eE]){1,2}(/|$))[Hh][Tt][Tt][Pp][Ss]://[Gg][Ii][Tt][Hh][Uu][Bb]\\.[Cc][Oo][Mm]/[A-Za-z0-9._-]+/[A-Za-z0-9._-]+(/tree(/[^/?#\\\\\\s\\u0085]+)+)?/?$"},
"tags": {"type": "array", "items": {"type": "string"}},
"preview": {
"type": "object",
"additionalProperties": false,
"properties": {"video": {"type": "string", "pattern": "^https://[^\\s]+$"}}
},
"versions": {"type": "array", "minItems": 1, "items": {"$ref": "#/$defs/release"}}
}
},
"release": {
"type": "object",
"required": ["version", "api", "url", "sha256", "effects"],
"additionalProperties": false,
"properties": {
"version": {"$ref": "#/$defs/version"},
"api": {"type": "integer", "minimum": 0, "maximum": 4294967295},
"minApp": {"$ref": "#/$defs/version"},
"url": {"$ref": "#/$defs/release_url"},
"sha256": {"type": "string", "pattern": "^[0-9a-fA-F]{64}$"},
"size": {"type": "integer", "minimum": 1, "maximum": 67108864},
"effects": {"type": "array", "minItems": 1, "items": {"type": "string", "pattern": "^(?!ec\\.)[A-Za-z0-9._-]+$"}}
}
}
}
}