feat(schema): enhance API configuration schemas with new properties and validations
All checks were successful
continuous-integration/drone/push Build is passing

- Updated collection.json to include upload defaults, audit logging, query limits, and more.
- Enhanced collectionNavigation.json with viewHint configurations.
- Added project-wide upload defaults and hook configurations in config.json.
- Expanded field.json to support new field types, validations, and properties.
- Improved fieldMeta.json with additional widget configurations and properties.
- Updated hooks.json to include new bulk operation hooks and audit logging.
- Enhanced imageFilter.json with additional image processing options.
- Added timeout properties to job.json for better execution control.
- Refined permissions.json to allow more granular control over HTTP method permissions and added filter and field visibility options.
This commit is contained in:
2026-03-30 12:28:50 +00:00
parent afa7c9b238
commit 025a7ccca4
10 changed files with 1504 additions and 128 deletions

View File

@@ -1,7 +1,7 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "JSON Schema tibi-server collection configuration",
"description": "tibi-server collection linter",
"description": "tibi-server collection configuration",
"type": "object",
"additionalProperties": false,
"patternProperties": {
@@ -22,14 +22,39 @@
"type": "string",
"description": "relative to config.yml, path for file uploads"
},
"upload": {
"type": "object",
"description": "collection-specific upload defaults and restrictions",
"additionalProperties": false,
"properties": {
"maxBodySize": {
"type": "string",
"description": "request body size limit override for this collection (e.g. '10MB')"
},
"allowedMimeTypes": {
"type": "array",
"description": "allowed MIME types for file uploads in this collection; empty means all types are allowed",
"items": {
"type": "string"
}
}
}
},
"meta": {
"oneOf": [
{ "$comment": "for include tag", "type": "string" },
{
"$comment": "for include tag",
"type": "string"
},
{
"type": "object",
"description": "meta object used for admin ui configuration",
"additionalProperties": true,
"allOf": [{ "$ref": "collectionNavigation.json" }],
"allOf": [
{
"$ref": "collectionNavigation.json"
}
],
"properties": {
"rowIdentTpl": {
"description": "template which evaluates to short string to identify entry in pe. select boxes",
@@ -57,6 +82,28 @@
}
}
]
},
"pagebuilder": {
"type": "object",
"description": "Collection-level pagebuilder defaults. These serve as fallbacks when field-level pagebuilder config omits them.",
"additionalProperties": false,
"properties": {
"blockTypeField": {
"type": "string",
"description": "Name of the sub-field that holds the block type identifier. Default: 'blockType'. Used as fallback for all pagebuilder fields in this collection."
},
"blockRegistry": {
"type": "object",
"description": "Block registry configuration.",
"additionalProperties": false,
"properties": {
"file": {
"type": "string",
"description": "URL to an ES module that default-exports a BlockRegistry. Used as fallback for all pagebuilder fields in this collection."
}
}
}
}
}
}
}
@@ -64,31 +111,54 @@
},
"projections": {
"oneOf": [
{ "$comment": "for include tag", "type": "string" },
{ "$ref": "projections.json" }
{
"$comment": "for include tag",
"type": "string"
},
{
"$ref": "projections.json"
}
]
},
"permissions": {
"oneOf": [
{ "$comment": "for include tag", "type": "string" },
{ "$ref": "permissions.json" }
{
"$comment": "for include tag",
"type": "string"
},
{
"$ref": "permissions.json"
}
]
},
"hooks": {
"oneOf": [
{ "$comment": "for include tag", "type": "string" },
{ "$ref": "hooks.json" }
{
"$comment": "for include tag",
"type": "string"
},
{
"$ref": "hooks.json"
}
]
},
"imageFilter": {
"oneOf": [
{ "$comment": "for include tag", "type": "string" },
{ "$ref": "imageFilter.json" }
{
"$comment": "for include tag",
"type": "string"
},
{
"$ref": "imageFilter.json"
}
]
},
"fields": {
"oneOf": [
{ "$comment": "for include tag", "type": "string" },
{
"$comment": "for include tag",
"type": "string"
},
{
"type": "array",
"description": "fields of collection",
@@ -108,7 +178,10 @@
},
"indexes": {
"oneOf": [
{ "$comment": "for include tag", "type": "string" },
{
"$comment": "for include tag",
"type": "string"
},
{
"type": "array",
"description": "indexes of collection",
@@ -126,6 +199,32 @@
}
]
},
"bulk": {
"type": "object",
"description": "bulk operation configuration",
"additionalProperties": false,
"properties": {
"optimize": {
"type": "object",
"description": "enable optimised single-DB-call bulk path without requiring a hook file",
"additionalProperties": false,
"properties": {
"create": {
"type": "boolean",
"description": "POST with JSON array uses optimised InsertMany path"
},
"update": {
"type": "boolean",
"description": "PUT without ID uses optimised path"
},
"delete": {
"type": "boolean",
"description": "DELETE without ID uses optimised path"
}
}
}
}
},
"cors": {
"type": "object",
"description": "cors configuration",
@@ -172,7 +271,119 @@
"description": "max age in seconds"
}
}
},
"audit": {
"type": "object",
"description": "audit logging configuration for this collection",
"additionalProperties": false,
"properties": {
"enabled": {
"type": "boolean",
"description": "enable audit logging for this collection"
},
"actions": {
"type": "array",
"description": "list of actions to audit (create, update, delete, bulkCreate, bulkUpdate, bulkDelete, get)",
"items": {
"type": "string",
"enum": [
"create",
"update",
"delete",
"bulkCreate",
"bulkUpdate",
"bulkDelete",
"get"
]
}
}
}
},
"queryLimits": {
"type": "object",
"description": "query limit configuration for GET requests",
"additionalProperties": false,
"properties": {
"defaultLimit": {
"type": "integer",
"description": "default limit for GET queries if client doesn't specify one"
},
"maxLimit": {
"type": "integer",
"description": "maximum allowed limit for GET queries"
}
}
},
"readonlyFields": {
"type": "array",
"description": "fields that are read-only at collection level",
"items": {
"type": "string"
}
},
"hiddenFields": {
"type": "array",
"description": "fields that are hidden at collection level",
"items": {
"type": "string"
}
},
"search": {
"type": "array",
"description": "search configurations for the collection",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string",
"description": "search config name (used in query parameter qName)"
},
"mode": {
"type": "string",
"description": "search mode",
"enum": [
"text",
"regex",
"eval",
"filter"
]
},
"fields": {
"type": "array",
"description": "fields to search in (for text/regex mode)",
"items": {
"type": "string"
}
},
"meta": {
"type": "object",
"description": "meta information",
"additionalProperties": true
},
"eval": {
"type": "string",
"description": "JS eval expression (for eval mode)"
},
"filter": {
"type": "object",
"description": "MongoDB filter template (for filter mode)",
"additionalProperties": true
}
},
"required": [
"name",
"mode"
]
}
},
"strictFields": {
"type": "boolean",
"description": "reject unknown fields not defined in the fields array"
}
},
"required": ["name", "permissions"]
}
"required": [
"name",
"permissions"
]
}