✨ 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,305 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$id": "field-meta.schema.json",
|
||||
"title": "Tibi field meta config",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"patternProperties": {
|
||||
"^x-": {}
|
||||
},
|
||||
"properties": {
|
||||
"label": {
|
||||
"$ref": "defs.schema.json#/definitions/i18nText"
|
||||
},
|
||||
"widget": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"text",
|
||||
"textarea",
|
||||
"checkbox",
|
||||
"switch",
|
||||
"select",
|
||||
"selectArray",
|
||||
"chipArray",
|
||||
"date",
|
||||
"datetime",
|
||||
"file",
|
||||
"image",
|
||||
"json",
|
||||
"richtext",
|
||||
"html",
|
||||
"foreignKey",
|
||||
"foreignKeyChipArray",
|
||||
"foreignFile",
|
||||
"foreignMedia",
|
||||
"pagebuilder",
|
||||
"pageBuilder",
|
||||
"containerLessObject",
|
||||
"containerLessObjectArray",
|
||||
"color"
|
||||
]
|
||||
},
|
||||
"i18n": {
|
||||
"const": false
|
||||
},
|
||||
"helperText": {
|
||||
"$ref": "defs.schema.json#/definitions/i18nText"
|
||||
},
|
||||
"hideLabel": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"hide": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"protected": {
|
||||
"$ref": "defs.schema.json#/definitions/boolOrUiCondition"
|
||||
},
|
||||
"position": {
|
||||
"type": "string",
|
||||
"pattern": "^(main|sidebar|sidebar:.+)$"
|
||||
},
|
||||
"section": {
|
||||
"type": "string"
|
||||
},
|
||||
"containerProps": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"class": {
|
||||
"type": "string"
|
||||
},
|
||||
"layout": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"breakBefore": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"breakAfter": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"size": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"default": {
|
||||
"type": "string"
|
||||
},
|
||||
"small": {
|
||||
"type": "string"
|
||||
},
|
||||
"large": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"defaultValue": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "number"
|
||||
},
|
||||
{
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
},
|
||||
{
|
||||
"type": "array"
|
||||
},
|
||||
{
|
||||
"type": "object"
|
||||
}
|
||||
]
|
||||
},
|
||||
"dependsOn": {
|
||||
"$ref": "defs.schema.json#/definitions/uiCondition"
|
||||
},
|
||||
"inputProps": {
|
||||
"type": "object",
|
||||
"additionalProperties": true
|
||||
},
|
||||
"choices": {
|
||||
"$ref": "defs.schema.json#/definitions/choices"
|
||||
},
|
||||
"foreign": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"collection": {
|
||||
"type": "string"
|
||||
},
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"sort": {
|
||||
"type": "string"
|
||||
},
|
||||
"projection": {
|
||||
"type": "string"
|
||||
},
|
||||
"filter": {
|
||||
"type": "object",
|
||||
"additionalProperties": true
|
||||
},
|
||||
"createDefaults": {
|
||||
"type": "object",
|
||||
"additionalProperties": true
|
||||
},
|
||||
"subNavigation": {
|
||||
"type": "integer",
|
||||
"minimum": 0
|
||||
},
|
||||
"render": {
|
||||
"$ref": "defs.schema.json#/definitions/foreignRender"
|
||||
},
|
||||
"autoFill": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"collection"
|
||||
]
|
||||
},
|
||||
"downscale": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"maxWidth": {
|
||||
"type": "number"
|
||||
},
|
||||
"maxHeight": {
|
||||
"type": "number"
|
||||
},
|
||||
"quality": {
|
||||
"type": "number"
|
||||
}
|
||||
}
|
||||
},
|
||||
"imageEditor": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"crop": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"rotate": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"flip": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"focalPoint": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"adjust": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"palette": {
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"drillDown": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"pageSize": {
|
||||
"type": "integer",
|
||||
"minimum": 0
|
||||
},
|
||||
"preview": {
|
||||
"$ref": "defs.schema.json#/definitions/previewConfig"
|
||||
},
|
||||
"addElementLabel": {
|
||||
"$ref": "defs.schema.json#/definitions/i18nText"
|
||||
},
|
||||
"filter": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "boolean",
|
||||
"description": "Set to true to opt-in this field as a filterable field in the admin UI, or false to explicitly exclude it."
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"default",
|
||||
"select",
|
||||
"bool",
|
||||
"boolean",
|
||||
"input",
|
||||
"number",
|
||||
"foreignKey"
|
||||
]
|
||||
},
|
||||
"facets": {
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"pagebuilder": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"defaultViewport": {
|
||||
"$ref": "defs.schema.json#/definitions/pagebuilderViewport"
|
||||
},
|
||||
"blockTypeField": {
|
||||
"type": "string"
|
||||
},
|
||||
"mode": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"overlay",
|
||||
"inline",
|
||||
"both"
|
||||
]
|
||||
},
|
||||
"blockRegistry": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"file": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"file"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"openapi": {
|
||||
"$ref": "openapi.schema.json#/definitions/fieldOpenapi"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user