diff --git a/demo-api/config.yml b/demo-api/config.yml index d87d423..a350dc0 100644 --- a/demo-api/config.yml +++ b/demo-api/config.yml @@ -4,6 +4,18 @@ namespace: myapi meta: # wird in der Admin-UI zum Projekt aufgegeben imageUrl: https://source.unsplash.com/random/?internet + tools: + - name: demo-overview + label: + de: Demo-Übersicht + en: Demo overview + description: + de: Beispiel-Tool für die Projekt-Übersicht + en: Example project overview tool + icon: view-dashboard-outline + group: tools + module: _/assets/tools/demo-overview/index.js + capabilities: [db, ui, log] # Liste aller möglichen Kollektionen (Listen, Seiten...) zum Projekt collections: diff --git a/schemas/config/project.schema.json b/schemas/config/project.schema.json index 7f6de1d..760973b 100644 --- a/schemas/config/project.schema.json +++ b/schemas/config/project.schema.json @@ -77,80 +77,7 @@ "tools": { "type": "array", "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "name", - "module" - ], - "properties": { - "name": { - "type": "string", - "pattern": "^[a-z0-9][a-z0-9-_]*$" - }, - "label": { - "oneOf": [ - { - "type": "string" - }, - { - "$ref": "defs.schema.json#/definitions/i18nText" - } - ] - }, - "description": { - "oneOf": [ - { - "type": "string" - }, - { - "$ref": "defs.schema.json#/definitions/i18nText" - } - ] - }, - "icon": { - "type": "string" - }, - "group": { - "type": "string" - }, - "module": { - "oneOf": [ - { - "type": "string" - }, - { - "$ref": "defs.schema.json#/definitions/evalString" - } - ] - }, - "permissions": { - "type": "array", - "items": { - "type": "string" - } - }, - "capabilities": { - "type": "array", - "items": { - "enum": [ - "db", - "files", - "xlsx", - "ui", - "log", - "progress", - "state" - ] - } - }, - "settings": { - "type": "object" - }, - "hidden": { - "type": "boolean" - } - } + "$ref": "tool.schema.json" } }, "i18n": { diff --git a/schemas/config/tool.schema.json b/schemas/config/tool.schema.json new file mode 100644 index 0000000..638740a --- /dev/null +++ b/schemas/config/tool.schema.json @@ -0,0 +1,79 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Custom Tool", + "description": "Project custom tool entry (meta.tools[]).", + "type": "object", + "additionalProperties": false, + "required": [ + "name", + "module" + ], + "properties": { + "name": { + "type": "string", + "pattern": "^[a-z0-9][a-z0-9-_]*$" + }, + "label": { + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "defs.schema.json#/definitions/i18nText" + } + ] + }, + "description": { + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "defs.schema.json#/definitions/i18nText" + } + ] + }, + "icon": { + "type": "string" + }, + "group": { + "type": "string" + }, + "module": { + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "defs.schema.json#/definitions/evalString" + } + ] + }, + "permissions": { + "type": "array", + "items": { + "type": "string" + } + }, + "capabilities": { + "type": "array", + "items": { + "enum": [ + "db", + "files", + "xlsx", + "ui", + "log", + "progress", + "state" + ] + } + }, + "settings": { + "type": "object" + }, + "hidden": { + "type": "boolean" + } + } +}