| 
									
										
										
										
											2021-07-20 12:12:30 +02:00
										 |  |  | 'use strict'; | 
					
						
							| 
									
										
										
										
											2022-08-08 15:50:34 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-14 10:48:29 -04:00
										 |  |  | const restrictAccess = require('../middlewares/restrict-access'); | 
					
						
							| 
									
										
										
										
											2021-07-20 12:12:30 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-24 13:59:43 +02:00
										 |  |  | module.exports = [ | 
					
						
							|  |  |  |   { | 
					
						
							|  |  |  |     method: 'GET', | 
					
						
							|  |  |  |     path: '/', | 
					
						
							| 
									
										
										
										
											2021-09-30 11:40:54 +02:00
										 |  |  |     handler: 'documentation.index', | 
					
						
							| 
									
										
										
										
											2021-08-24 13:59:43 +02:00
										 |  |  |     config: { | 
					
						
							| 
									
										
										
										
											2021-09-02 11:25:24 +02:00
										 |  |  |       auth: false, | 
					
						
							| 
									
										
										
										
											2021-10-14 10:48:29 -04:00
										 |  |  |       middlewares: [restrictAccess], | 
					
						
							| 
									
										
										
										
											2021-08-24 13:59:43 +02:00
										 |  |  |     }, | 
					
						
							|  |  |  |   }, | 
					
						
							|  |  |  |   { | 
					
						
							|  |  |  |     method: 'GET', | 
					
						
							|  |  |  |     path: '/v:major(\\d+).:minor(\\d+).:patch(\\d+)', | 
					
						
							| 
									
										
										
										
											2021-09-30 11:40:54 +02:00
										 |  |  |     handler: 'documentation.index', | 
					
						
							| 
									
										
										
										
											2021-08-24 13:59:43 +02:00
										 |  |  |     config: { | 
					
						
							| 
									
										
										
										
											2021-09-02 11:25:24 +02:00
										 |  |  |       auth: false, | 
					
						
							| 
									
										
										
										
											2021-10-14 10:48:29 -04:00
										 |  |  |       middlewares: [restrictAccess], | 
					
						
							| 
									
										
										
										
											2021-08-24 13:59:43 +02:00
										 |  |  |     }, | 
					
						
							|  |  |  |   }, | 
					
						
							|  |  |  |   { | 
					
						
							|  |  |  |     method: 'GET', | 
					
						
							|  |  |  |     path: '/login', | 
					
						
							| 
									
										
										
										
											2021-09-30 11:40:54 +02:00
										 |  |  |     handler: 'documentation.loginView', | 
					
						
							| 
									
										
										
										
											2021-08-24 13:59:43 +02:00
										 |  |  |     config: { | 
					
						
							| 
									
										
										
										
											2021-10-14 10:48:29 -04:00
										 |  |  |       auth: false, | 
					
						
							| 
									
										
										
										
											2021-08-24 13:59:43 +02:00
										 |  |  |     }, | 
					
						
							|  |  |  |   }, | 
					
						
							|  |  |  |   { | 
					
						
							|  |  |  |     method: 'POST', | 
					
						
							|  |  |  |     path: '/login', | 
					
						
							| 
									
										
										
										
											2021-09-30 11:40:54 +02:00
										 |  |  |     handler: 'documentation.login', | 
					
						
							| 
									
										
										
										
											2021-08-24 13:59:43 +02:00
										 |  |  |     config: { | 
					
						
							| 
									
										
										
										
											2021-10-14 10:48:29 -04:00
										 |  |  |       auth: false, | 
					
						
							| 
									
										
										
										
											2021-08-24 13:59:43 +02:00
										 |  |  |     }, | 
					
						
							|  |  |  |   }, | 
					
						
							|  |  |  |   { | 
					
						
							|  |  |  |     method: 'GET', | 
					
						
							|  |  |  |     path: '/getInfos', | 
					
						
							| 
									
										
										
										
											2021-09-30 11:40:54 +02:00
										 |  |  |     handler: 'documentation.getInfos', | 
					
						
							| 
									
										
										
										
											2021-08-24 13:59:43 +02:00
										 |  |  |     config: { | 
					
						
							|  |  |  |       policies: [ | 
					
						
							| 
									
										
										
										
											2021-10-04 18:16:28 +02:00
										 |  |  |         { name: 'admin::hasPermissions', config: { actions: ['plugin::documentation.read'] } }, | 
					
						
							| 
									
										
										
										
											2021-08-24 13:59:43 +02:00
										 |  |  |       ], | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |   }, | 
					
						
							|  |  |  |   { | 
					
						
							|  |  |  |     method: 'POST', | 
					
						
							|  |  |  |     path: '/regenerateDoc', | 
					
						
							| 
									
										
										
										
											2021-09-30 11:40:54 +02:00
										 |  |  |     handler: 'documentation.regenerateDoc', | 
					
						
							| 
									
										
										
										
											2021-08-24 13:59:43 +02:00
										 |  |  |     config: { | 
					
						
							|  |  |  |       policies: [ | 
					
						
							|  |  |  |         { | 
					
						
							|  |  |  |           name: 'admin::hasPermissions', | 
					
						
							| 
									
										
										
										
											2021-10-04 18:16:28 +02:00
										 |  |  |           config: { actions: ['plugin::documentation.settings.regenerate'] }, | 
					
						
							| 
									
										
										
										
											2021-08-24 13:59:43 +02:00
										 |  |  |         }, | 
					
						
							|  |  |  |       ], | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |   }, | 
					
						
							|  |  |  |   { | 
					
						
							|  |  |  |     method: 'PUT', | 
					
						
							|  |  |  |     path: '/updateSettings', | 
					
						
							| 
									
										
										
										
											2021-09-30 11:40:54 +02:00
										 |  |  |     handler: 'documentation.updateSettings', | 
					
						
							| 
									
										
										
										
											2021-08-24 13:59:43 +02:00
										 |  |  |     config: { | 
					
						
							|  |  |  |       policies: [ | 
					
						
							|  |  |  |         { | 
					
						
							|  |  |  |           name: 'admin::hasPermissions', | 
					
						
							| 
									
										
										
										
											2021-10-04 18:16:28 +02:00
										 |  |  |           config: { actions: ['plugin::documentation.settings.update'] }, | 
					
						
							| 
									
										
										
										
											2021-08-24 13:59:43 +02:00
										 |  |  |         }, | 
					
						
							|  |  |  |       ], | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |   }, | 
					
						
							|  |  |  |   { | 
					
						
							|  |  |  |     method: 'DELETE', | 
					
						
							|  |  |  |     path: '/deleteDoc/:version', | 
					
						
							| 
									
										
										
										
											2021-09-30 11:40:54 +02:00
										 |  |  |     handler: 'documentation.deleteDoc', | 
					
						
							| 
									
										
										
										
											2021-08-24 13:59:43 +02:00
										 |  |  |     config: { | 
					
						
							|  |  |  |       policies: [], | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |   }, | 
					
						
							|  |  |  | ]; |