feat: add toolbox contract shell and testkit
This commit is contained in:
219
schemas/toolbox-app.v1.schema.json
Normal file
219
schemas/toolbox-app.v1.schema.json
Normal file
@@ -0,0 +1,219 @@
|
||||
{
|
||||
"$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
|
||||
}
|
||||
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