| 
									
										
										
										
											2021-09-03 23:19:03 +02:00
										 |  |  | 'use strict'; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-24 09:35:25 +02:00
										 |  |  | const { routing } = require('../middlewares'); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-03 23:19:03 +02:00
										 |  |  | module.exports = { | 
					
						
							| 
									
										
										
										
											2021-09-06 10:55:47 +02:00
										 |  |  |   type: 'admin', | 
					
						
							| 
									
										
										
										
											2021-09-03 23:19:03 +02:00
										 |  |  |   routes: [ | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |       method: 'GET', | 
					
						
							|  |  |  |       path: '/content-types', | 
					
						
							|  |  |  |       handler: 'content-types.findContentTypes', | 
					
						
							|  |  |  |       config: { | 
					
						
							|  |  |  |         policies: [], | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |       method: 'GET', | 
					
						
							|  |  |  |       path: '/content-types-settings', | 
					
						
							|  |  |  |       handler: 'content-types.findContentTypesSettings', | 
					
						
							|  |  |  |       config: { | 
					
						
							|  |  |  |         policies: [], | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |       method: 'GET', | 
					
						
							|  |  |  |       path: '/content-types/:uid/configuration', | 
					
						
							|  |  |  |       handler: 'content-types.findContentTypeConfiguration', | 
					
						
							|  |  |  |       config: { | 
					
						
							|  |  |  |         policies: [], | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |       method: 'PUT', | 
					
						
							|  |  |  |       path: '/content-types/:uid/configuration', | 
					
						
							|  |  |  |       handler: 'content-types.updateContentTypeConfiguration', | 
					
						
							|  |  |  |       config: { | 
					
						
							|  |  |  |         policies: ['admin::isAuthenticatedAdmin'], | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |       method: 'GET', | 
					
						
							|  |  |  |       path: '/components', | 
					
						
							|  |  |  |       handler: 'components.findComponents', | 
					
						
							|  |  |  |       config: { | 
					
						
							|  |  |  |         policies: [], | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |       method: 'GET', | 
					
						
							|  |  |  |       path: '/components/:uid/configuration', | 
					
						
							|  |  |  |       handler: 'components.findComponentConfiguration', | 
					
						
							|  |  |  |       config: { | 
					
						
							|  |  |  |         policies: [], | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |       method: 'PUT', | 
					
						
							|  |  |  |       path: '/components/:uid/configuration', | 
					
						
							|  |  |  |       handler: 'components.updateComponentConfiguration', | 
					
						
							|  |  |  |       config: { | 
					
						
							|  |  |  |         policies: [], | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |       method: 'POST', | 
					
						
							|  |  |  |       path: '/uid/generate', | 
					
						
							|  |  |  |       handler: 'uid.generateUID', | 
					
						
							|  |  |  |       config: { | 
					
						
							|  |  |  |         policies: [], | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |       method: 'POST', | 
					
						
							|  |  |  |       path: '/uid/check-availability', | 
					
						
							|  |  |  |       handler: 'uid.checkUIDAvailability', | 
					
						
							|  |  |  |       config: { | 
					
						
							|  |  |  |         policies: [], | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2022-08-05 16:05:52 +02:00
										 |  |  |       method: 'GET', | 
					
						
							| 
									
										
										
										
											2021-09-03 23:19:03 +02:00
										 |  |  |       path: '/relations/:model/:targetField', | 
					
						
							| 
									
										
										
										
											2022-08-11 15:52:58 +02:00
										 |  |  |       handler: 'relations.findAvailable', | 
					
						
							| 
									
										
										
										
											2021-09-03 23:19:03 +02:00
										 |  |  |       config: { | 
					
						
							| 
									
										
										
										
											2022-10-04 17:10:18 +02:00
										 |  |  |         policies: ['admin::isAuthenticatedAdmin'], | 
					
						
							| 
									
										
										
										
											2021-09-03 23:19:03 +02:00
										 |  |  |       }, | 
					
						
							|  |  |  |     }, | 
					
						
							| 
									
										
										
										
											2022-10-04 12:01:52 +02:00
										 |  |  |     { | 
					
						
							|  |  |  |       method: 'GET', | 
					
						
							|  |  |  |       path: '/relations/:model/:id/:targetField', | 
					
						
							|  |  |  |       handler: 'relations.findExisting', | 
					
						
							|  |  |  |       config: { | 
					
						
							|  |  |  |         policies: ['admin::isAuthenticatedAdmin'], | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |     }, | 
					
						
							| 
									
										
										
										
											2021-09-03 23:19:03 +02:00
										 |  |  |     { | 
					
						
							|  |  |  |       method: 'GET', | 
					
						
							|  |  |  |       path: '/single-types/:model', | 
					
						
							|  |  |  |       handler: 'single-types.find', | 
					
						
							|  |  |  |       config: { | 
					
						
							| 
									
										
										
										
											2021-09-24 09:35:25 +02:00
										 |  |  |         middlewares: [routing], | 
					
						
							| 
									
										
										
										
											2021-09-03 23:19:03 +02:00
										 |  |  |         policies: [ | 
					
						
							|  |  |  |           'admin::isAuthenticatedAdmin', | 
					
						
							|  |  |  |           { | 
					
						
							|  |  |  |             name: 'plugin::content-manager.hasPermissions', | 
					
						
							| 
									
										
										
										
											2021-10-04 18:16:28 +02:00
										 |  |  |             config: { actions: ['plugin::content-manager.explorer.read'] }, | 
					
						
							| 
									
										
										
										
											2021-09-03 23:19:03 +02:00
										 |  |  |           }, | 
					
						
							|  |  |  |         ], | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |       method: 'PUT', | 
					
						
							|  |  |  |       path: '/single-types/:model', | 
					
						
							|  |  |  |       handler: 'single-types.createOrUpdate', | 
					
						
							|  |  |  |       config: { | 
					
						
							| 
									
										
										
										
											2021-09-24 09:35:25 +02:00
										 |  |  |         middlewares: [routing], | 
					
						
							| 
									
										
										
										
											2021-09-03 23:19:03 +02:00
										 |  |  |         policies: [ | 
					
						
							|  |  |  |           'admin::isAuthenticatedAdmin', | 
					
						
							|  |  |  |           { | 
					
						
							|  |  |  |             name: 'plugin::content-manager.hasPermissions', | 
					
						
							| 
									
										
										
										
											2021-10-04 18:16:28 +02:00
										 |  |  |             config: { | 
					
						
							| 
									
										
										
										
											2021-09-03 23:19:03 +02:00
										 |  |  |               actions: [ | 
					
						
							|  |  |  |                 'plugin::content-manager.explorer.create', | 
					
						
							|  |  |  |                 'plugin::content-manager.explorer.update', | 
					
						
							|  |  |  |               ], | 
					
						
							|  |  |  |               hasAtLeastOne: true, | 
					
						
							|  |  |  |             }, | 
					
						
							|  |  |  |           }, | 
					
						
							|  |  |  |         ], | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |       method: 'DELETE', | 
					
						
							|  |  |  |       path: '/single-types/:model', | 
					
						
							|  |  |  |       handler: 'single-types.delete', | 
					
						
							|  |  |  |       config: { | 
					
						
							| 
									
										
										
										
											2021-09-24 09:35:25 +02:00
										 |  |  |         middlewares: [routing], | 
					
						
							| 
									
										
										
										
											2021-09-03 23:19:03 +02:00
										 |  |  |         policies: [ | 
					
						
							|  |  |  |           'admin::isAuthenticatedAdmin', | 
					
						
							|  |  |  |           { | 
					
						
							|  |  |  |             name: 'plugin::content-manager.hasPermissions', | 
					
						
							| 
									
										
										
										
											2021-10-04 18:16:28 +02:00
										 |  |  |             config: { actions: ['plugin::content-manager.explorer.delete'] }, | 
					
						
							| 
									
										
										
										
											2021-09-03 23:19:03 +02:00
										 |  |  |           }, | 
					
						
							|  |  |  |         ], | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |       method: 'POST', | 
					
						
							|  |  |  |       path: '/single-types/:model/actions/publish', | 
					
						
							|  |  |  |       handler: 'single-types.publish', | 
					
						
							|  |  |  |       config: { | 
					
						
							| 
									
										
										
										
											2021-09-24 09:35:25 +02:00
										 |  |  |         middlewares: [routing], | 
					
						
							| 
									
										
										
										
											2021-09-03 23:19:03 +02:00
										 |  |  |         policies: [ | 
					
						
							|  |  |  |           'plugin::content-manager.has-draft-and-publish', | 
					
						
							|  |  |  |           'admin::isAuthenticatedAdmin', | 
					
						
							|  |  |  |           { | 
					
						
							|  |  |  |             name: 'plugin::content-manager.hasPermissions', | 
					
						
							| 
									
										
										
										
											2021-10-04 18:16:28 +02:00
										 |  |  |             config: { actions: ['plugin::content-manager.explorer.publish'] }, | 
					
						
							| 
									
										
										
										
											2021-09-03 23:19:03 +02:00
										 |  |  |           }, | 
					
						
							|  |  |  |         ], | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |       method: 'POST', | 
					
						
							|  |  |  |       path: '/single-types/:model/actions/unpublish', | 
					
						
							|  |  |  |       handler: 'single-types.unpublish', | 
					
						
							|  |  |  |       config: { | 
					
						
							| 
									
										
										
										
											2021-09-24 09:35:25 +02:00
										 |  |  |         middlewares: [routing], | 
					
						
							| 
									
										
										
										
											2021-09-03 23:19:03 +02:00
										 |  |  |         policies: [ | 
					
						
							|  |  |  |           'plugin::content-manager.has-draft-and-publish', | 
					
						
							|  |  |  |           'admin::isAuthenticatedAdmin', | 
					
						
							|  |  |  |           { | 
					
						
							|  |  |  |             name: 'plugin::content-manager.hasPermissions', | 
					
						
							| 
									
										
										
										
											2021-10-04 18:16:28 +02:00
										 |  |  |             config: { actions: ['plugin::content-manager.explorer.publish'] }, | 
					
						
							| 
									
										
										
										
											2021-09-03 23:19:03 +02:00
										 |  |  |           }, | 
					
						
							|  |  |  |         ], | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |     }, | 
					
						
							| 
									
										
										
										
											2022-10-05 18:42:50 +02:00
										 |  |  |     { | 
					
						
							|  |  |  |       method: 'GET', | 
					
						
							| 
									
										
										
										
											2022-10-07 12:49:08 +02:00
										 |  |  |       path: '/single-types/:model/actions/numberOfDraftRelations', | 
					
						
							| 
									
										
										
										
											2022-10-05 18:42:50 +02:00
										 |  |  |       handler: 'single-types.getNumberOfDraftRelations', | 
					
						
							|  |  |  |       config: { | 
					
						
							|  |  |  |         middlewares: [routing], | 
					
						
							|  |  |  |         policies: [ | 
					
						
							|  |  |  |           'admin::isAuthenticatedAdmin', | 
					
						
							|  |  |  |           { | 
					
						
							|  |  |  |             name: 'plugin::content-manager.hasPermissions', | 
					
						
							| 
									
										
										
										
											2021-10-04 18:16:28 +02:00
										 |  |  |             config: { actions: ['plugin::content-manager.explorer.read'] }, | 
					
						
							| 
									
										
										
										
											2021-09-03 23:19:03 +02:00
										 |  |  |           }, | 
					
						
							|  |  |  |         ], | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |       method: 'GET', | 
					
						
							|  |  |  |       path: '/collection-types/:model', | 
					
						
							|  |  |  |       handler: 'collection-types.find', | 
					
						
							|  |  |  |       config: { | 
					
						
							| 
									
										
										
										
											2021-09-24 09:35:25 +02:00
										 |  |  |         middlewares: [routing], | 
					
						
							| 
									
										
										
										
											2021-09-03 23:19:03 +02:00
										 |  |  |         policies: [ | 
					
						
							|  |  |  |           'admin::isAuthenticatedAdmin', | 
					
						
							|  |  |  |           { | 
					
						
							|  |  |  |             name: 'plugin::content-manager.hasPermissions', | 
					
						
							| 
									
										
										
										
											2021-10-04 18:16:28 +02:00
										 |  |  |             config: { actions: ['plugin::content-manager.explorer.read'] }, | 
					
						
							| 
									
										
										
										
											2021-09-03 23:19:03 +02:00
										 |  |  |           }, | 
					
						
							|  |  |  |         ], | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |       method: 'POST', | 
					
						
							|  |  |  |       path: '/collection-types/:model', | 
					
						
							|  |  |  |       handler: 'collection-types.create', | 
					
						
							|  |  |  |       config: { | 
					
						
							| 
									
										
										
										
											2021-09-24 09:35:25 +02:00
										 |  |  |         middlewares: [routing], | 
					
						
							| 
									
										
										
										
											2021-09-03 23:19:03 +02:00
										 |  |  |         policies: [ | 
					
						
							|  |  |  |           'admin::isAuthenticatedAdmin', | 
					
						
							|  |  |  |           { | 
					
						
							|  |  |  |             name: 'plugin::content-manager.hasPermissions', | 
					
						
							| 
									
										
										
										
											2021-10-04 18:16:28 +02:00
										 |  |  |             config: { actions: ['plugin::content-manager.explorer.create'] }, | 
					
						
							| 
									
										
										
										
											2021-09-03 23:19:03 +02:00
										 |  |  |           }, | 
					
						
							|  |  |  |         ], | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |       method: 'GET', | 
					
						
							|  |  |  |       path: '/collection-types/:model/:id', | 
					
						
							|  |  |  |       handler: 'collection-types.findOne', | 
					
						
							|  |  |  |       config: { | 
					
						
							| 
									
										
										
										
											2021-09-24 09:35:25 +02:00
										 |  |  |         middlewares: [routing], | 
					
						
							| 
									
										
										
										
											2021-09-03 23:19:03 +02:00
										 |  |  |         policies: [ | 
					
						
							|  |  |  |           'admin::isAuthenticatedAdmin', | 
					
						
							|  |  |  |           { | 
					
						
							|  |  |  |             name: 'plugin::content-manager.hasPermissions', | 
					
						
							| 
									
										
										
										
											2021-10-04 18:16:28 +02:00
										 |  |  |             config: { actions: ['plugin::content-manager.explorer.read'] }, | 
					
						
							| 
									
										
										
										
											2021-09-03 23:19:03 +02:00
										 |  |  |           }, | 
					
						
							|  |  |  |         ], | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |       method: 'PUT', | 
					
						
							|  |  |  |       path: '/collection-types/:model/:id', | 
					
						
							|  |  |  |       handler: 'collection-types.update', | 
					
						
							|  |  |  |       config: { | 
					
						
							| 
									
										
										
										
											2021-09-24 09:35:25 +02:00
										 |  |  |         middlewares: [routing], | 
					
						
							| 
									
										
										
										
											2021-09-03 23:19:03 +02:00
										 |  |  |         policies: [ | 
					
						
							|  |  |  |           'admin::isAuthenticatedAdmin', | 
					
						
							|  |  |  |           { | 
					
						
							|  |  |  |             name: 'plugin::content-manager.hasPermissions', | 
					
						
							| 
									
										
										
										
											2021-10-04 18:16:28 +02:00
										 |  |  |             config: { actions: ['plugin::content-manager.explorer.update'] }, | 
					
						
							| 
									
										
										
										
											2021-09-03 23:19:03 +02:00
										 |  |  |           }, | 
					
						
							|  |  |  |         ], | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |       method: 'DELETE', | 
					
						
							|  |  |  |       path: '/collection-types/:model/:id', | 
					
						
							|  |  |  |       handler: 'collection-types.delete', | 
					
						
							|  |  |  |       config: { | 
					
						
							| 
									
										
										
										
											2021-09-24 09:35:25 +02:00
										 |  |  |         middlewares: [routing], | 
					
						
							| 
									
										
										
										
											2021-09-03 23:19:03 +02:00
										 |  |  |         policies: [ | 
					
						
							|  |  |  |           'admin::isAuthenticatedAdmin', | 
					
						
							|  |  |  |           { | 
					
						
							|  |  |  |             name: 'plugin::content-manager.hasPermissions', | 
					
						
							| 
									
										
										
										
											2021-10-04 18:16:28 +02:00
										 |  |  |             config: { actions: ['plugin::content-manager.explorer.delete'] }, | 
					
						
							| 
									
										
										
										
											2021-09-03 23:19:03 +02:00
										 |  |  |           }, | 
					
						
							|  |  |  |         ], | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |       method: 'POST', | 
					
						
							|  |  |  |       path: '/collection-types/:model/:id/actions/publish', | 
					
						
							|  |  |  |       handler: 'collection-types.publish', | 
					
						
							|  |  |  |       config: { | 
					
						
							| 
									
										
										
										
											2021-09-24 09:35:25 +02:00
										 |  |  |         middlewares: [routing], | 
					
						
							| 
									
										
										
										
											2021-09-03 23:19:03 +02:00
										 |  |  |         policies: [ | 
					
						
							|  |  |  |           'plugin::content-manager.has-draft-and-publish', | 
					
						
							|  |  |  |           'admin::isAuthenticatedAdmin', | 
					
						
							|  |  |  |           { | 
					
						
							|  |  |  |             name: 'plugin::content-manager.hasPermissions', | 
					
						
							| 
									
										
										
										
											2021-10-04 18:16:28 +02:00
										 |  |  |             config: { actions: ['plugin::content-manager.explorer.publish'] }, | 
					
						
							| 
									
										
										
										
											2021-09-03 23:19:03 +02:00
										 |  |  |           }, | 
					
						
							|  |  |  |         ], | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |       method: 'POST', | 
					
						
							|  |  |  |       path: '/collection-types/:model/:id/actions/unpublish', | 
					
						
							|  |  |  |       handler: 'collection-types.unpublish', | 
					
						
							|  |  |  |       config: { | 
					
						
							| 
									
										
										
										
											2021-09-24 09:35:25 +02:00
										 |  |  |         middlewares: [routing], | 
					
						
							| 
									
										
										
										
											2021-09-03 23:19:03 +02:00
										 |  |  |         policies: [ | 
					
						
							|  |  |  |           'plugin::content-manager.has-draft-and-publish', | 
					
						
							|  |  |  |           'admin::isAuthenticatedAdmin', | 
					
						
							|  |  |  |           { | 
					
						
							|  |  |  |             name: 'plugin::content-manager.hasPermissions', | 
					
						
							| 
									
										
										
										
											2021-10-04 18:16:28 +02:00
										 |  |  |             config: { actions: ['plugin::content-manager.explorer.publish'] }, | 
					
						
							| 
									
										
										
										
											2021-09-03 23:19:03 +02:00
										 |  |  |           }, | 
					
						
							|  |  |  |         ], | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |       method: 'POST', | 
					
						
							|  |  |  |       path: '/collection-types/:model/actions/bulkDelete', | 
					
						
							|  |  |  |       handler: 'collection-types.bulkDelete', | 
					
						
							|  |  |  |       config: { | 
					
						
							| 
									
										
										
										
											2021-09-24 09:35:25 +02:00
										 |  |  |         middlewares: [routing], | 
					
						
							| 
									
										
										
										
											2021-09-03 23:19:03 +02:00
										 |  |  |         policies: [ | 
					
						
							|  |  |  |           'admin::isAuthenticatedAdmin', | 
					
						
							|  |  |  |           { | 
					
						
							|  |  |  |             name: 'plugin::content-manager.hasPermissions', | 
					
						
							| 
									
										
										
										
											2021-10-04 18:16:28 +02:00
										 |  |  |             config: { actions: ['plugin::content-manager.explorer.delete'] }, | 
					
						
							| 
									
										
										
										
											2021-09-03 23:19:03 +02:00
										 |  |  |           }, | 
					
						
							|  |  |  |         ], | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |     }, | 
					
						
							| 
									
										
										
										
											2022-10-05 18:42:50 +02:00
										 |  |  |     { | 
					
						
							|  |  |  |       method: 'GET', | 
					
						
							|  |  |  |       path: '/collection-types/:model/:id/actions/numberOfDraftRelations', | 
					
						
							|  |  |  |       handler: 'collection-types.getNumberOfDraftRelations', | 
					
						
							|  |  |  |       config: { | 
					
						
							|  |  |  |         middlewares: [routing], | 
					
						
							|  |  |  |         policies: [ | 
					
						
							|  |  |  |           'admin::isAuthenticatedAdmin', | 
					
						
							|  |  |  |           { | 
					
						
							|  |  |  |             name: 'plugin::content-manager.hasPermissions', | 
					
						
							|  |  |  |             config: { actions: ['plugin::content-manager.explorer.read'] }, | 
					
						
							|  |  |  |           }, | 
					
						
							|  |  |  |         ], | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |     }, | 
					
						
							| 
									
										
										
										
											2021-09-03 23:19:03 +02:00
										 |  |  |   ], | 
					
						
							|  |  |  | }; |