{ "$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" } } } } }