/** Whether this caller may change webhooks, as opposed to only reading them. */
/** Whether this caller may change webhooks, as opposed to only reading them. */
functionmayManage(req: FastifyRequest):boolean{
functionmayManage(req: FastifyRequest):boolean{
@ -108,31 +108,18 @@ async function routes(app: FastifyInstance) {
},
},
schema:{
schema:{
summary:'List the events a webhook can subscribe to',
summary:'List the events a webhook can subscribe to',
description:
'Only the `user:*` events are emitted at the moment. Pages, assets and comments are not implemented yet, so a subscription to those is stored but never triggered.',
tags:['Webhooks'],
tags:['Webhooks'],
response:{
response:{
200:{
200:{
description:'List of event keys',
description:'List of event keys',
type:'array',
type:'array',
items:{
items:{type:'string'}
type:'object',
properties:{
key:{
type:'string'
},
isEmitted:{
type:'boolean',
description:'Whether anything in the server currently emits this event.'