Files
toolbox-sdk/schemas/toolbox-catalog.v1.schema.json

121 lines
3.2 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://git.add-ideas.de/lotobo/toolbox-sdk/raw/branch/main/schemas/toolbox-catalog.v1.schema.json",
"title": "Toolbox catalog v1",
"type": "object",
"required": ["schemaVersion", "id", "name", "home", "theme", "apps"],
"properties": {
"schemaVersion": {
"const": 1
},
"id": {
"type": "string",
"pattern": "^[a-z0-9]+(?:[._-][a-z0-9]+)*$"
},
"name": {
"$ref": "#/$defs/nonEmptyString"
},
"home": {
"$ref": "#/$defs/urlReference"
},
"theme": {
"type": "object",
"required": ["mode", "brand"],
"properties": {
"mode": {
"enum": ["light", "dark", "system"]
},
"brand": {
"$ref": "#/$defs/nonEmptyString"
}
},
"additionalProperties": true
},
"apps": {
"type": "array",
"items": {
"oneOf": [
{
"type": "object",
"required": ["manifest", "enabled"],
"not": {
"required": ["entry"]
},
"properties": {
"manifest": {
"$ref": "#/$defs/urlReference"
},
"enabled": {
"type": "boolean"
}
},
"additionalProperties": true
},
{
"type": "object",
"required": ["name", "entry", "launch", "enabled"],
"not": {
"required": ["manifest"]
},
"properties": {
"name": {
"$ref": "#/$defs/nonEmptyString"
},
"entry": {
"$ref": "#/$defs/urlReference"
},
"launch": {
"enum": ["navigate", "new-tab"]
},
"enabled": {
"type": "boolean"
}
},
"additionalProperties": true
}
]
}
}
},
"$defs": {
"urlReference": {
"type": "string",
"allOf": [
{
"$ref": "#/$defs/nonEmptyString"
},
{
"type": "string",
"description": "URL references must not contain C0 control characters or DEL.",
"pattern": "^[^\\u0000-\\u001F\\u007F]*$"
},
{
"type": "string",
"description": "Backslashes are not URL path separators in toolbox documents.",
"pattern": "^[^\\\\]*$"
},
{
"type": "string",
"description": "Explicit schemes are limited to HTTP and HTTPS; relative references remain valid.",
"pattern": "^ *(?:[Hh][Tt][Tt][Pp][Ss]?:|(?!(?:[A-Za-z][A-Za-z0-9+.-]*):))"
},
{
"type": "string",
"description": "An explicit HTTP(S) authority must not be empty.",
"pattern": "^(?! *[Hh][Tt][Tt][Pp][Ss]?:/+(?:[?#]|$))"
},
{
"type": "string",
"description": "HTTP(S) authority references must not contain credentials.",
"pattern": "^ *(?!(?:[Hh][Tt][Tt][Pp]:/*|[Hh][Tt][Tt][Pp][Ss]:/+|/+)[^/?#]*@)"
}
]
},
"nonEmptyString": {
"type": "string",
"pattern": "\\S"
}
},
"additionalProperties": true
}