Files
apairon 40b441df04 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.
2026-07-01 09:23:43 +00:00

508 lines
11 KiB
JSON

{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "defs.schema.json",
"title": "Shared definitions for Tibi config schemas",
"definitions": {
"i18nText": {
"oneOf": [
{
"type": "string"
},
{
"type": "object",
"minProperties": 1,
"patternProperties": {
"^[a-z]{2}(-[A-Za-z0-9_]+)?$": {
"type": "string"
}
},
"additionalProperties": false
}
]
},
"fieldPath": {
"type": "string",
"pattern": "^[a-zA-Z0-9_]+(\\.[a-zA-Z0-9_]+)*$"
},
"evalString": {
"type": "object",
"additionalProperties": false,
"properties": {
"eval": {
"type": "string"
},
"select": {
"type": "array",
"items": {
"$ref": "defs.schema.json#/definitions/fieldPath"
}
}
},
"required": [
"eval"
]
},
"evalHtml": {
"type": "object",
"additionalProperties": false,
"properties": {
"eval": {
"type": "string"
},
"raw": {
"type": "boolean"
}
},
"required": [
"eval"
]
},
"boolOrEval": {
"oneOf": [
{
"type": "boolean"
},
{
"$ref": "defs.schema.json#/definitions/evalString"
}
]
},
"boolOrUiCondition": {
"oneOf": [
{
"type": "boolean"
},
{
"type": "string"
},
{
"$ref": "defs.schema.json#/definitions/evalString"
}
]
},
"uiCondition": {
"oneOf": [
{
"type": "string"
},
{
"$ref": "defs.schema.json#/definitions/evalString"
}
]
},
"sortField": {
"oneOf": [
{
"$ref": "defs.schema.json#/definitions/fieldPath"
},
{
"type": "object",
"additionalProperties": false,
"properties": {
"source": {
"$ref": "defs.schema.json#/definitions/fieldPath"
}
},
"required": [
"source"
]
}
]
},
"pagebuilderViewport": {
"oneOf": [
{
"type": "integer",
"minimum": 1
},
{
"type": "string",
"enum": [
"desktop",
"tablet",
"phone"
]
}
]
},
"badgeVariant": {
"type": "string",
"enum": [
"success",
"error",
"warning",
"info",
"neutral"
]
},
"choiceItem": {
"type": "object",
"additionalProperties": false,
"properties": {
"id": {
"type": [
"string",
"number",
"boolean",
"null"
]
},
"value": {
"type": [
"string",
"number",
"boolean",
"null"
]
},
"name": {
"$ref": "defs.schema.json#/definitions/i18nText"
},
"label": {
"$ref": "defs.schema.json#/definitions/i18nText"
},
"description": {
"$ref": "defs.schema.json#/definitions/i18nText"
},
"badgeVariant": {
"$ref": "defs.schema.json#/definitions/badgeVariant"
},
"chipVariant": {
"$ref": "defs.schema.json#/definitions/badgeVariant"
},
"badgeStyle": {
"type": "object",
"description": "Flat inline CSS properties for badge/chip rendering. Supports camelCase, kebab-case, and CSS custom properties. `bg`/`text` are aliases for `background`/`color`.",
"additionalProperties": {
"type": [
"string",
"number",
"boolean"
]
}
},
"chipStyle": {
"type": "object",
"description": "Alias for badgeStyle with the same value shape.",
"additionalProperties": {
"type": [
"string",
"number",
"boolean"
]
}
}
},
"anyOf": [
{
"required": [
"id"
]
},
{
"required": [
"value"
]
}
],
"anyOfComment": "Choice labels are optional for now because some block-type helper lists are resolved elsewhere."
},
"choices": {
"oneOf": [
{
"type": "array",
"items": {
"$ref": "defs.schema.json#/definitions/choiceItem"
}
},
{
"type": "object",
"additionalProperties": false,
"properties": {
"endpoint": {
"type": "string"
},
"mapping": {
"type": "object",
"additionalProperties": false,
"properties": {
"id": {
"type": "string"
},
"name": {
"type": "string"
}
}
},
"params": {
"type": "object",
"additionalProperties": true
}
},
"required": [
"endpoint"
]
}
]
},
"previewTableColumn": {
"oneOf": [
{
"$ref": "defs.schema.json#/definitions/fieldPath"
},
{
"type": "object",
"additionalProperties": false,
"properties": {
"source": {
"$ref": "defs.schema.json#/definitions/fieldPath"
},
"label": {
"$ref": "defs.schema.json#/definitions/i18nText"
},
"align": {
"type": "string",
"enum": [
"left",
"center",
"right"
]
},
"eval": {
"type": "string"
},
"raw": {
"type": "boolean"
},
"select": {
"type": "array",
"items": {
"$ref": "defs.schema.json#/definitions/fieldPath"
}
}
},
"anyOf": [
{
"required": [
"source"
]
},
{
"required": [
"eval"
]
}
]
}
]
},
"previewSlots": {
"type": "object",
"additionalProperties": false,
"properties": {
"label": {
"oneOf": [
{
"$ref": "defs.schema.json#/definitions/fieldPath"
},
{
"$ref": "defs.schema.json#/definitions/evalString"
}
]
},
"labelStyle": {
"oneOf": [
{
"$ref": "defs.schema.json#/definitions/fieldPath"
},
{
"$ref": "defs.schema.json#/definitions/evalString"
}
]
},
"secondary": {
"oneOf": [
{
"$ref": "defs.schema.json#/definitions/fieldPath"
},
{
"$ref": "defs.schema.json#/definitions/evalString"
}
]
},
"tertiary": {
"oneOf": [
{
"$ref": "defs.schema.json#/definitions/fieldPath"
},
{
"$ref": "defs.schema.json#/definitions/evalString"
}
]
},
"badge": {
"oneOf": [
{
"$ref": "defs.schema.json#/definitions/fieldPath"
},
{
"$ref": "defs.schema.json#/definitions/evalString"
}
]
},
"image": {
"oneOf": [
{
"$ref": "defs.schema.json#/definitions/fieldPath"
},
{
"$ref": "defs.schema.json#/definitions/evalString"
}
]
},
"imageFallback": {
"oneOf": [
{
"$ref": "defs.schema.json#/definitions/fieldPath"
},
{
"$ref": "defs.schema.json#/definitions/evalString"
}
]
},
"mediaFile": {
"$ref": "defs.schema.json#/definitions/fieldPath"
},
"eval": {
"type": "string"
},
"raw": {
"type": "boolean"
},
"select": {
"type": "array",
"items": {
"$ref": "defs.schema.json#/definitions/fieldPath"
}
},
"table": {
"type": "array",
"items": {
"$ref": "defs.schema.json#/definitions/previewTableColumn"
}
}
},
"anyOf": [
{
"required": [
"label"
]
},
{
"required": [
"secondary"
]
},
{
"required": [
"tertiary"
]
},
{
"required": [
"badge"
]
},
{
"required": [
"image"
]
},
{
"required": [
"table"
]
}
]
},
"previewConfig": {
"oneOf": [
{
"$ref": "defs.schema.json#/definitions/fieldPath"
},
{
"$ref": "defs.schema.json#/definitions/evalHtml"
},
{
"$ref": "defs.schema.json#/definitions/previewSlots"
}
]
},
"foreignRender": {
"oneOf": [
{
"$ref": "defs.schema.json#/definitions/fieldPath"
},
{
"$ref": "defs.schema.json#/definitions/evalHtml"
},
{
"type": "object",
"additionalProperties": false,
"properties": {
"defaultCollectionViews": {
"type": "boolean"
}
},
"required": [
"defaultCollectionViews"
]
},
{
"$ref": "defs.schema.json#/definitions/previewSlots"
}
]
},
"methodPermissionGet": {
"oneOf": [
{
"type": "boolean"
},
{
"type": "object",
"additionalProperties": false,
"properties": {
"allow": {
"type": "boolean"
}
},
"required": [
"allow"
]
}
]
},
"methodPermissionWrite": {
"oneOf": [
{
"type": "boolean"
},
{
"type": "object",
"additionalProperties": false,
"properties": {
"allow": {
"type": "boolean"
},
"bulk": {
"type": "boolean"
}
},
"required": [
"allow"
]
}
]
}
}
}