Skip to content

Commit 49771bb

Browse files
committed
merge flag and multiFlag triggers
1 parent addd25e commit 49771bb

File tree

1 file changed

+20
-47
lines changed

1 file changed

+20
-47
lines changed

ctf/templates/init/schemas/post.json

Lines changed: 20 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,9 @@
2626
"type": "string",
2727
"enum": [
2828
"flag",
29-
"multiFlag",
3029
"score",
3130
"timer"
3231
]
33-
},
34-
"tag": {
35-
"description": "Value of the trigger. For a flag trigger, this is the flag value.",
36-
"type": "string",
37-
"minLength": 1
3832
}
3933
},
4034
"required": [
@@ -50,9 +44,17 @@
5044
"then": {
5145
"properties": {
5246
"tag": {
53-
"description": "Discourse tag of the flag to trigger on.",
54-
"type": "string",
47+
"description": "Discourse tags of the flags to trigger on.",
48+
"type": ["string", "array"],
49+
"items": {
50+
"type": "string",
51+
"minLength": 1
52+
},
5553
"minLength": 1
54+
},
55+
"threshold": {
56+
"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.",
57+
"type": "number"
5658
}
5759
},
5860
"required": [
@@ -64,66 +66,37 @@
6466
"if": {
6567
"properties": {
6668
"type": {
67-
"const": "multiFlag"
69+
"const": "score"
6870
}
6971
}
7072
},
7173
"then": {
72-
"properties": {
73-
"tags": {
74-
"description": "List of discourse tags of relevant flags.",
75-
"type": "array",
76-
"items": {
77-
"type": "string",
78-
"minLength": 1
79-
}
80-
},
81-
"threshold": {
82-
"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.",
83-
"type": "number"
84-
}
74+
"value": {
75+
"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.",
76+
"type": "number"
8577
},
8678
"required": [
8779
"type",
88-
"tags"
80+
"value"
8981
]
9082
},
9183
"else": {
9284
"if": {
9385
"properties": {
9486
"type": {
95-
"const": "score"
87+
"const": "timer"
9688
}
9789
}
9890
},
9991
"then": {
100-
"value": {
101-
"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.",
102-
"type": "number"
92+
"after": {
93+
"description": "Time at which to trigger. The layout of this string is \"2006/01/02 15:04\"",
94+
"type": "string"
10395
},
10496
"required": [
10597
"type",
106-
"value"
98+
"after"
10799
]
108-
},
109-
"else": {
110-
"if": {
111-
"properties": {
112-
"type": {
113-
"const": "timer"
114-
}
115-
}
116-
},
117-
"then": {
118-
"after": {
119-
"description": "Time at which to trigger. The layout of this string is \"2006/01/02 15:04\"",
120-
"type": "string"
121-
},
122-
"required": [
123-
"type",
124-
"after"
125-
]
126-
}
127100
}
128101
}
129102
}

0 commit comments

Comments
 (0)