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

145 lines
3.5 KiB
JSON

{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "hooks.schema.json",
"title": "Tibi hooks config",
"type": "object",
"additionalProperties": false,
"patternProperties": {
"^x-": {}
},
"properties": {
"get": {
"$ref": "hooks.schema.json#/definitions/getHooks"
},
"post": {
"$ref": "hooks.schema.json#/definitions/postHooks"
},
"put": {
"$ref": "hooks.schema.json#/definitions/putHooks"
},
"delete": {
"$ref": "hooks.schema.json#/definitions/deleteHooks"
},
"audit": {
"$ref": "hooks.schema.json#/definitions/auditHooks"
}
},
"definitions": {
"hook": {
"type": "object",
"additionalProperties": false,
"properties": {
"type": {
"const": "javascript"
},
"file": {
"type": "string"
},
"timeout": {
"type": "integer",
"minimum": 0
}
},
"required": [
"type",
"file"
]
},
"getHooks": {
"type": "object",
"additionalProperties": false,
"properties": {
"handle": {
"$ref": "hooks.schema.json#/definitions/hook"
},
"read": {
"$ref": "hooks.schema.json#/definitions/hook"
},
"return": {
"$ref": "hooks.schema.json#/definitions/hook"
},
"file": {
"$ref": "hooks.schema.json#/definitions/hook"
}
}
},
"postHooks": {
"type": "object",
"additionalProperties": false,
"properties": {
"bind": {
"$ref": "hooks.schema.json#/definitions/hook"
},
"validate": {
"$ref": "hooks.schema.json#/definitions/hook"
},
"handle": {
"$ref": "hooks.schema.json#/definitions/hook"
},
"create": {
"$ref": "hooks.schema.json#/definitions/hook"
},
"return": {
"$ref": "hooks.schema.json#/definitions/hook"
},
"bulkCreate": {
"$ref": "hooks.schema.json#/definitions/hook"
},
"bulkReturn": {
"$ref": "hooks.schema.json#/definitions/hook"
}
}
},
"putHooks": {
"type": "object",
"additionalProperties": false,
"properties": {
"bind": {
"$ref": "hooks.schema.json#/definitions/hook"
},
"validate": {
"$ref": "hooks.schema.json#/definitions/hook"
},
"update": {
"$ref": "hooks.schema.json#/definitions/hook"
},
"return": {
"$ref": "hooks.schema.json#/definitions/hook"
},
"bulkUpdate": {
"$ref": "hooks.schema.json#/definitions/hook"
},
"bulkReturn": {
"$ref": "hooks.schema.json#/definitions/hook"
}
}
},
"deleteHooks": {
"type": "object",
"additionalProperties": false,
"properties": {
"delete": {
"$ref": "hooks.schema.json#/definitions/hook"
},
"return": {
"$ref": "hooks.schema.json#/definitions/hook"
},
"bulkDelete": {
"$ref": "hooks.schema.json#/definitions/hook"
},
"bulkReturn": {
"$ref": "hooks.schema.json#/definitions/hook"
}
}
},
"auditHooks": {
"type": "object",
"additionalProperties": false,
"properties": {
"return": {
"$ref": "hooks.schema.json#/definitions/hook"
}
}
}
}
}