diff --git a/ctf/templates/init/schemas/post.json b/ctf/templates/init/schemas/post.json index f548068..a4134f8 100644 --- a/ctf/templates/init/schemas/post.json +++ b/ctf/templates/init/schemas/post.json @@ -25,19 +25,81 @@ "description": "Type of trigger: use `flag` to post after a given flag is submitted (the value of the flag should be set in the `tag` property.)", "type": "string", "enum": [ - "flag" + "flag", + "score", + "timer" ] - }, - "tag": { - "description": "Value of the trigger. For a flag trigger, this is the flag value.", - "type": "string", - "minLength": 1 } }, "required": [ - "type", - "tag" - ] + "type" + ], + "if": { + "properties": { + "type": { + "const": "flag" + } + } + }, + "then": { + "properties": { + "tag": { + "description": "Discourse tags of the flags to trigger on.", + "type": ["string", "array"], + "items": { + "type": "string", + "minLength": 1 + }, + "minLength": 1 + }, + "threshold": { + "description": "Number of relevant flags required for the multiFlag trigger. Ex: If this is set to 2, the trigger will only fire if 2 or more of the tags in the `tags` list are present.", + "type": "number" + } + }, + "required": [ + "type", + "tag" + ] + }, + "else": { + "if": { + "properties": { + "type": { + "const": "score" + } + } + }, + "then": { + "value": { + "description": "Value of the score trigger. Ex: If this is set to 10, the trigger will only fire if the user's score is 10 or more.", + "type": "number" + }, + "required": [ + "type", + "value" + ] + }, + "else": { + "if": { + "properties": { + "type": { + "const": "timer" + } + } + }, + "then": { + "after": { + "description": "Time at which to trigger. The layout of this string is \"2006/01/02 15:04\"", + "type": "string" + }, + "required": [ + "type", + "after" + ] + } + } + } }, "api": { "type": "object",