diff --git a/index.d.ts b/index.d.ts index 9efd521..f0f7989 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1009,9 +1009,15 @@ declare global { file?: string /** - * execution timeout in seconds + * Abbruch nach dieser Zeit. Nackte Zahl = Millisekunden (Altform), + * String = Go-Duration ("30s", "5m"). */ - timeout?: number + timeout?: number | string + + /** + * Überschreibt die Projekt-Engine für diesen Job. + */ + engine?: "goja" | "v8" } interface JobData { diff --git a/schemas/config/hooks.schema.json b/schemas/config/hooks.schema.json index 75b5fd8..a72f8ad 100644 --- a/schemas/config/hooks.schema.json +++ b/schemas/config/hooks.schema.json @@ -36,8 +36,28 @@ "type": "string" }, "timeout": { - "type": "integer", - "minimum": 0 + "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": [ @@ -142,4 +162,4 @@ } } } -} \ No newline at end of file +} diff --git a/schemas/config/job.schema.json b/schemas/config/job.schema.json index 8ecd012..05aedf7 100644 --- a/schemas/config/job.schema.json +++ b/schemas/config/job.schema.json @@ -18,16 +18,32 @@ "type": "string" }, "timeout": { - "type": "integer", - "minimum": 0 + "description": "Abbruch nach dieser Zeit. Akzeptiert Millisekunden (30000) oder eine Go-Duration (\"30s\", \"5m\").", + "oneOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "type": "string", + "pattern": "^[0-9]+(\\.[0-9]+)?(ns|us|µs|ms|s|m|h)$" + } + ] }, "meta": { "type": "object", "additionalProperties": true + }, + "engine": { + "description": "Überschreibt die Projekt-Engine für diesen Job.", + "enum": [ + "goja", + "v8" + ] } }, "required": [ "type", "file" ] -} \ No newline at end of file +} diff --git a/schemas/config/project.schema.json b/schemas/config/project.schema.json index 4951d7c..1e0487d 100644 --- a/schemas/config/project.schema.json +++ b/schemas/config/project.schema.json @@ -412,6 +412,13 @@ "type": "boolean" } } + }, + "jsEngine": { + "description": "JS-Engine für dieses Projekt (überschreibt server.js.engine).", + "enum": [ + "goja", + "v8" + ] } }, "required": [ @@ -434,4 +441,4 @@ } } } -} \ No newline at end of file +}