feat: add toolbox contract shell and testkit
This commit is contained in:
115
schemas/toolbox-catalog.v1.schema.json
Normal file
115
schemas/toolbox-catalog.v1.schema.json
Normal file
@@ -0,0 +1,115 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "https://git.add-ideas.de/zemion/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": "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]:/+|/+)[^/?#]*@)"
|
||||
}
|
||||
]
|
||||
},
|
||||
"nonEmptyString": {
|
||||
"type": "string",
|
||||
"pattern": "\\S"
|
||||
}
|
||||
},
|
||||
"additionalProperties": true
|
||||
}
|
||||
Reference in New Issue
Block a user