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

220 lines
5.2 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://git.add-ideas.de/zemion/toolbox-sdk/raw/branch/main/schemas/toolbox-app.v1.schema.json",
"title": "Toolbox application manifest v1",
"type": "object",
"required": [
"schemaVersion",
"id",
"name",
"version",
"description",
"entry",
"icon",
"categories",
"tags",
"integration",
"requirements",
"privacy"
],
"properties": {
"schemaVersion": {
"const": 1
},
"id": {
"type": "string",
"pattern": "^[a-z0-9]+(?:[._-][a-z0-9]+)*$"
},
"name": {
"$ref": "#/$defs/nonEmptyString"
},
"version": {
"$ref": "#/$defs/nonEmptyString"
},
"entry": {
"$ref": "#/$defs/urlReference"
},
"description": {
"type": "string"
},
"icon": {
"$ref": "#/$defs/urlReference"
},
"privacy": {
"type": "object",
"required": ["processing", "fileUploads", "telemetry"],
"properties": {
"processing": {
"enum": ["local", "remote", "mixed"]
},
"fileUploads": {
"type": "boolean"
},
"telemetry": {
"type": "boolean"
},
"label": {
"$ref": "#/$defs/nonEmptyString"
},
"url": {
"$ref": "#/$defs/urlReference"
}
},
"additionalProperties": true
},
"categories": {
"$ref": "#/$defs/stringList"
},
"tags": {
"$ref": "#/$defs/stringList"
},
"integration": {
"type": "object",
"required": ["contextVersion", "launchModes", "embedding"],
"properties": {
"contextVersion": {
"const": 1
},
"launchModes": {
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": {
"enum": ["navigate", "new-tab"]
}
},
"embedding": {
"enum": ["unsupported", "supported"]
}
},
"additionalProperties": true
},
"requirements": {
"type": "object",
"required": [
"secureContext",
"workers",
"indexedDb",
"crossOriginIsolated"
],
"properties": {
"secureContext": {
"type": "boolean"
},
"workers": {
"type": "boolean"
},
"indexedDb": {
"type": "boolean"
},
"crossOriginIsolated": {
"type": "boolean"
},
"topLevelContext": {
"type": "boolean"
}
},
"additionalProperties": true
},
"source": {
"type": "object",
"required": ["repository", "license"],
"properties": {
"repository": {
"$ref": "#/$defs/absoluteWebUrl"
},
"license": {
"$ref": "#/$defs/nonEmptyString"
}
},
"additionalProperties": true
},
"actions": {
"type": "array",
"items": {
"type": "object",
"required": ["id", "label", "url"],
"properties": {
"id": {
"type": "string",
"pattern": "^[a-z0-9]+(?:[._-][a-z0-9]+)*$"
},
"label": {
"$ref": "#/$defs/nonEmptyString"
},
"url": {
"$ref": "#/$defs/urlReference"
}
},
"additionalProperties": true
}
},
"assets": {
"type": "array",
"items": {
"$ref": "#/$defs/urlReference"
},
"uniqueItems": true
}
},
"$defs": {
"urlReference": {
"type": "string",
"allOf": [
{
"$ref": "#/$defs/nonEmptyString"
},
{
"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": "^[\\t\\n\\r ]*(?:[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": "^(?![\\t\\n\\r ]*[Hh][Tt][Tt][Pp][Ss]?:/+(?:[?#]|$))"
},
{
"type": "string",
"description": "HTTP(S) authority references must not contain credentials.",
"pattern": "^[\\t\\n\\r ]*(?!(?:[Hh][Tt][Tt][Pp]:/*|[Hh][Tt][Tt][Pp][Ss]:/+|/+)[^/?#]*@)"
}
]
},
"absoluteWebUrl": {
"allOf": [
{
"$ref": "#/$defs/urlReference"
},
{
"type": "string",
"description": "Repository URLs must be absolute HTTP(S) URLs.",
"pattern": "^[\\t\\n\\r ]*[Hh][Tt][Tt][Pp][Ss]?:/*[^\\s/?#]"
},
{
"type": "string",
"description": "Absolute repository URLs must not contain credentials.",
"pattern": "^[\\t\\n\\r ]*(?![Hh][Tt][Tt][Pp][Ss]?:/*[^/?#]*@)"
}
]
},
"nonEmptyString": {
"type": "string",
"pattern": "\\S"
},
"stringList": {
"type": "array",
"uniqueItems": true,
"items": {
"$ref": "#/$defs/nonEmptyString"
}
}
},
"additionalProperties": true
}