✨ feat: add new JSON schemas for Tibi configuration including fields, hooks, jobs, and permissions
- Introduced `field-list.schema.json`, `field-meta.schema.json`, and `field.schema.json` for field configurations. - Added `hooks.schema.json` for defining hooks in the Tibi project. - Created `image-filter.schema.json` for image processing configurations. - Implemented `job.schema.json` for job scheduling configurations. - Added `openapi.schema.json` for OpenAPI metadata generation. - Introduced `permissions.schema.json` for managing permissions in the project. - Created `project.schema.json` for overall project configuration. - Added `projections.schema.json` for defining projections in the project. - Implemented a validation script `validate-schemas.mjs` to ensure schema compliance.
This commit is contained in:
@@ -0,0 +1,380 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$id": "collection-meta.schema.json",
|
||||
"title": "Tibi collection meta config",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"patternProperties": {
|
||||
"^x-": {}
|
||||
},
|
||||
"properties": {
|
||||
"label": {
|
||||
"$ref": "defs.schema.json#/definitions/i18nText"
|
||||
},
|
||||
"muiIcon": {
|
||||
"type": "string"
|
||||
},
|
||||
"group": {
|
||||
"type": "string"
|
||||
},
|
||||
"imageUrl": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"$ref": "defs.schema.json#/definitions/evalString"
|
||||
}
|
||||
]
|
||||
},
|
||||
"hide": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"singleton": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"enabled": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"key": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"enabled"
|
||||
]
|
||||
},
|
||||
"subNavigation": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"label": {
|
||||
"$ref": "defs.schema.json#/definitions/i18nText"
|
||||
},
|
||||
"muiIcon": {
|
||||
"type": "string"
|
||||
},
|
||||
"filter": {
|
||||
"type": "object",
|
||||
"additionalProperties": true
|
||||
},
|
||||
"defaultSort": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"field": {
|
||||
"$ref": "defs.schema.json#/definitions/sortField"
|
||||
},
|
||||
"order": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"ASC",
|
||||
"DESC"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"field"
|
||||
]
|
||||
},
|
||||
"setDefault": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"description": "Pre-fill a field with a default value when creating a new entry while this subNav tab is active.",
|
||||
"properties": {
|
||||
"field": {
|
||||
"type": "string"
|
||||
},
|
||||
"value": {}
|
||||
},
|
||||
"required": [
|
||||
"field",
|
||||
"value"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name"
|
||||
]
|
||||
}
|
||||
},
|
||||
"preview": {
|
||||
"$ref": "defs.schema.json#/definitions/previewConfig"
|
||||
},
|
||||
"i18n": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "boolean",
|
||||
"enum": [
|
||||
false
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"defaultLanguage": {
|
||||
"type": "string"
|
||||
},
|
||||
"languages": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"code": {
|
||||
"type": "string"
|
||||
},
|
||||
"label": {
|
||||
"$ref": "defs.schema.json#/definitions/i18nText"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"code"
|
||||
]
|
||||
}
|
||||
},
|
||||
"entry": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"languageField": {
|
||||
"type": "string"
|
||||
},
|
||||
"groupField": {
|
||||
"type": "string"
|
||||
},
|
||||
"clearFields": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"copyFields": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"languageField",
|
||||
"groupField"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"defaultSort": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"field": {
|
||||
"$ref": "defs.schema.json#/definitions/sortField"
|
||||
},
|
||||
"order": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"ASC",
|
||||
"DESC",
|
||||
"MANUALLY"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"field"
|
||||
]
|
||||
},
|
||||
"viewHint": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"table",
|
||||
"cards"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"media": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"upload": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"autoFill": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"ai": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"targetField": {
|
||||
"type": "string"
|
||||
},
|
||||
"prompt": {
|
||||
"type": "string"
|
||||
},
|
||||
"image": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"maxWidth": {
|
||||
"type": "number",
|
||||
"exclusiveMinimum": 0
|
||||
},
|
||||
"maxHeight": {
|
||||
"type": "number",
|
||||
"exclusiveMinimum": 0
|
||||
},
|
||||
"quality": {
|
||||
"type": "number",
|
||||
"exclusiveMinimum": 0,
|
||||
"maximum": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"navigation": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"nodesField": {
|
||||
"type": "string"
|
||||
},
|
||||
"preview": {
|
||||
"$ref": "defs.schema.json#/definitions/previewConfig"
|
||||
},
|
||||
"declaredTrees": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"label": {
|
||||
"$ref": "defs.schema.json#/definitions/i18nText"
|
||||
},
|
||||
"singleton": {
|
||||
"type": "object",
|
||||
"additionalProperties": true
|
||||
},
|
||||
"maxLevel": {
|
||||
"type": "number"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"singleton"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"oneOf": [
|
||||
{
|
||||
"required": [
|
||||
"media"
|
||||
]
|
||||
},
|
||||
{
|
||||
"required": [
|
||||
"navigation"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"pagebuilder": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"defaultViewport": {
|
||||
"$ref": "defs.schema.json#/definitions/pagebuilderViewport"
|
||||
},
|
||||
"blockTypeField": {
|
||||
"type": "string"
|
||||
},
|
||||
"blockRegistry": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"file": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
]
|
||||
},
|
||||
"screenshot": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"field": {
|
||||
"$ref": "defs.schema.json#/definitions/fieldPath"
|
||||
},
|
||||
"fileField": {
|
||||
"$ref": "defs.schema.json#/definitions/fieldPath"
|
||||
},
|
||||
"screenWidth": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
},
|
||||
"imageWidth": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"field",
|
||||
"fileField"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"sidebar": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"group": {
|
||||
"type": "string"
|
||||
},
|
||||
"label": {
|
||||
"$ref": "defs.schema.json#/definitions/i18nText"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"group"
|
||||
]
|
||||
}
|
||||
},
|
||||
"openapi": {
|
||||
"$ref": "openapi.schema.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user