Files
tibi-types/schemas/config/hooks.schema.json
T
apairon e935dc7cc1 ✨ types(config): engine/jsEngine und Duration-Timeouts
- hooks.schema.json: `timeout` akzeptiert Integer (ms) oder Go-Duration-String;
  neu `engine` (goja|v8) und `ignoreRequestCancel`.
- job.schema.json: `timeout` Integer oder String; neu `engine`.
- project.schema.json: neu `jsEngine` (goja|v8).
- index.d.ts: JobConfig.timeout ist `number | string` (Beschreibung war
  fälschlich "seconds"), neu `engine`.
2026-11-13 10:41:03 +00:00

166 lines
4.1 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": {
"description": "Abbruch nach dieser Zeit. Akzeptiert Millisekunden (500) oder eine Go-Duration (\"500ms\", \"2s\").",
"oneOf": [
{
"type": "integer",
"minimum": 0
},
{
"type": "string",
"pattern": "^[0-9]+(\\.[0-9]+)?(ns|us|µs|ms|s|m|h)$"
}
]
},
"engine": {
"description": "Überschreibt die Projekt-Engine für diesen Hook.",
"enum": [
"goja",
"v8"
]
},
"ignoreRequestCancel": {
"description": "Hook läuft weiter, wenn der Client die Verbindung abbricht (z. B. SSE).",
"type": "boolean"
}
},
"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"
}
}
}
}
}