File tree Expand file tree Collapse file tree 2 files changed +94
-0
lines changed Expand file tree Collapse file tree 2 files changed +94
-0
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,54 @@ export default {
5353 examples : [ 'coderoad' ]
5454 }
5555 } ,
56+ webhooks : {
57+ type : 'object' ,
58+ description : 'Optional configuration for setting up webhook events' ,
59+ properties : {
60+ endpoint : {
61+ type : 'string' ,
62+ description :
63+ 'Webhook endpoint to hit on events. Uses HTTP POST requests' ,
64+ examples : [ 'https://api.com/v1/coderoad' ]
65+ } ,
66+ headers : {
67+ type : 'object' ,
68+ description : 'Headers for the webhook request in JSON format' ,
69+ examples : [ '{ x-token: "$CODEROAD_WEBHOOK_TOKEN" }' ] ,
70+ additionalProperties : true
71+ } ,
72+ events : {
73+ type : 'object' ,
74+ description :
75+ 'A configuration of possible events toggled on or off' ,
76+ properties : {
77+ init : {
78+ type : 'boolean' ,
79+ description : 'Trigger webhook when user starts a tutorial'
80+ } ,
81+ reset : {
82+ type : 'boolean' ,
83+ description :
84+ 'Trigger webhook when user resets a CodeRoad tutorial'
85+ } ,
86+ step_complete : {
87+ type : 'boolean' ,
88+ description : 'Trigger webhook when user completes a step'
89+ } ,
90+ level_complete : {
91+ type : 'boolean' ,
92+ description : 'Trigger webhook when user completes a level'
93+ } ,
94+ tutorial_complete : {
95+ type : 'boolean' ,
96+ description :
97+ 'Trigger webhook when user completes a tutorial'
98+ }
99+ } ,
100+ additionalProperties : false
101+ }
102+ }
103+ } ,
56104 required : [ 'command' , 'args' ]
57105 } ,
58106 setup : {
Original file line number Diff line number Diff line change @@ -159,6 +159,52 @@ export default {
159159 }
160160 }
161161 } ,
162+ webhooks : {
163+ type : 'object' ,
164+ description : 'Optional configuration for setting up webhook events' ,
165+ properties : {
166+ endpoint : {
167+ type : 'string' ,
168+ description :
169+ 'Webhook endpoint to hit on events. Uses HTTP POST requests' ,
170+ examples : [ 'https://api.com/v1/coderoad' ]
171+ } ,
172+ headers : {
173+ type : 'object' ,
174+ description : 'Headers for the webhook request in JSON format' ,
175+ examples : [ '{ x-token: "$CODEROAD_WEBHOOK_TOKEN" }' ] ,
176+ additionalProperties : true
177+ } ,
178+ events : {
179+ type : 'object' ,
180+ description : 'A configuration of possible events toggled on or off' ,
181+ properties : {
182+ init : {
183+ type : 'boolean' ,
184+ description : 'Trigger webhook when user starts a tutorial'
185+ } ,
186+ reset : {
187+ type : 'boolean' ,
188+ description :
189+ 'Trigger webhook when user resets a CodeRoad tutorial'
190+ } ,
191+ step_complete : {
192+ type : 'boolean' ,
193+ description : 'Trigger webhook when user completes a step'
194+ } ,
195+ level_complete : {
196+ type : 'boolean' ,
197+ description : 'Trigger webhook when user completes a level'
198+ } ,
199+ tutorial_complete : {
200+ type : 'boolean' ,
201+ description : 'Trigger webhook when user completes a tutorial'
202+ }
203+ } ,
204+ additionalProperties : false
205+ }
206+ }
207+ } ,
162208 additionalProperties : false ,
163209 required : [ 'testRunner' , 'repo' ]
164210 } ,
You can’t perform that action at this time.
0 commit comments