mirror of
				https://github.com/strapi/strapi.git
				synced 2025-10-30 01:17:28 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			79 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			79 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| 'use strict';
 | |
| 
 | |
| module.exports = [
 | |
|   {
 | |
|     method: 'GET',
 | |
|     path: '/webhooks',
 | |
|     handler: 'webhooks.listWebhooks',
 | |
|     config: {
 | |
|       policies: [
 | |
|         'admin::isAuthenticatedAdmin',
 | |
|         { name: 'admin::hasPermissions', config: { actions: ['admin::webhooks.read'] } },
 | |
|       ],
 | |
|     },
 | |
|   },
 | |
|   {
 | |
|     method: 'POST',
 | |
|     path: '/webhooks',
 | |
|     handler: 'webhooks.createWebhook',
 | |
|     config: {
 | |
|       policies: [
 | |
|         'admin::isAuthenticatedAdmin',
 | |
|         { name: 'admin::hasPermissions', config: { actions: ['admin::webhooks.create'] } },
 | |
|       ],
 | |
|     },
 | |
|   },
 | |
|   {
 | |
|     method: 'GET',
 | |
|     path: '/webhooks/:id',
 | |
|     handler: 'webhooks.getWebhook',
 | |
|     config: {
 | |
|       policies: [
 | |
|         'admin::isAuthenticatedAdmin',
 | |
|         { name: 'admin::hasPermissions', config: { actions: ['admin::webhooks.read'] } },
 | |
|       ],
 | |
|     },
 | |
|   },
 | |
|   {
 | |
|     method: 'PUT',
 | |
|     path: '/webhooks/:id',
 | |
|     handler: 'webhooks.updateWebhook',
 | |
|     config: {
 | |
|       policies: [
 | |
|         'admin::isAuthenticatedAdmin',
 | |
|         { name: 'admin::hasPermissions', config: { actions: ['admin::webhooks.update'] } },
 | |
|       ],
 | |
|     },
 | |
|   },
 | |
|   {
 | |
|     method: 'DELETE',
 | |
|     path: '/webhooks/:id',
 | |
|     handler: 'webhooks.deleteWebhook',
 | |
|     config: {
 | |
|       policies: [
 | |
|         'admin::isAuthenticatedAdmin',
 | |
|         { name: 'admin::hasPermissions', config: { actions: ['admin::webhooks.delete'] } },
 | |
|       ],
 | |
|     },
 | |
|   },
 | |
|   {
 | |
|     method: 'POST',
 | |
|     path: '/webhooks/batch-delete',
 | |
|     handler: 'webhooks.deleteWebhooks',
 | |
|     config: {
 | |
|       policies: [
 | |
|         'admin::isAuthenticatedAdmin',
 | |
|         { name: 'admin::hasPermissions', config: { actions: ['admin::webhooks.delete'] } },
 | |
|       ],
 | |
|     },
 | |
|   },
 | |
|   {
 | |
|     method: 'POST',
 | |
|     path: '/webhooks/:id/trigger',
 | |
|     handler: 'webhooks.triggerWebhook',
 | |
|     config: {
 | |
|       policies: [],
 | |
|     },
 | |
|   },
 | |
| ];
 | 
