2020-11-11 02:57:43 +00:00
|
|
|
module.exports = exports = {
|
|
|
|
prefix: '/api/v1/page',
|
|
|
|
|
2020-11-11 18:23:31 +00:00
|
|
|
middleware: [],
|
2020-11-11 02:57:43 +00:00
|
|
|
|
|
|
|
get: {
|
|
|
|
// Get the data for the specified page
|
2020-11-13 03:26:36 +00:00
|
|
|
'/:PageId': [
|
|
|
|
'middleware::auth:ApiRoute',
|
|
|
|
['middleware::api:DataInjection', { access_level: 'view' }],
|
|
|
|
'controller::api:v1:Page.get_page',
|
|
|
|
],
|
2020-11-11 02:57:43 +00:00
|
|
|
|
|
|
|
// Get the available versions of the given page
|
2020-11-13 03:26:36 +00:00
|
|
|
'/:PageId/versions': [
|
|
|
|
'middleware::auth:ApiRoute',
|
|
|
|
['middleware::api:DataInjection', { access_level: 'view' }],
|
|
|
|
'controller::api:v1:Page.get_page_versions',
|
|
|
|
],
|
2020-11-11 02:57:43 +00:00
|
|
|
|
|
|
|
// Get the nodes present on the specified page
|
2020-11-13 03:26:36 +00:00
|
|
|
'/:PageId/nodes': [
|
|
|
|
'middleware::auth:ApiRoute',
|
|
|
|
['middleware::api:DataInjection', { access_level: 'view' }],
|
|
|
|
'controller::api:v1:Page.get_nodes',
|
|
|
|
],
|
2020-11-11 02:57:43 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
post: {
|
|
|
|
// Save the data for the specified page
|
2020-11-13 03:26:36 +00:00
|
|
|
'/:PageId/save': [
|
|
|
|
'middleware::auth:ApiRoute',
|
|
|
|
['middleware::api:DataInjection', { access_level: 'update' }],
|
|
|
|
'controller::api:v1:Page.save_page',
|
|
|
|
],
|
2020-11-11 02:57:43 +00:00
|
|
|
|
|
|
|
// Revert the page to a previous version
|
2020-11-13 03:26:36 +00:00
|
|
|
'/:PageId/versions/revert': [
|
|
|
|
'middleware::auth:ApiRoute',
|
|
|
|
['middleware::api:DataInjection', { access_level: 'manage' }],
|
|
|
|
'controller::api:v1:Page.revert_version',
|
|
|
|
],
|
2020-11-11 02:57:43 +00:00
|
|
|
|
|
|
|
// Save the node data for the specified page
|
2020-11-13 03:26:36 +00:00
|
|
|
'/:PageId/nodes/save': [
|
|
|
|
'middleware::auth:ApiRoute',
|
|
|
|
['middleware::api:DataInjection', { access_level: 'update' }],
|
|
|
|
'controller::api:v1:Page.save_nodes',
|
|
|
|
],
|
2020-11-11 02:57:43 +00:00
|
|
|
|
2020-11-13 03:26:36 +00:00
|
|
|
'/:PageId/nodes/save_one': [
|
|
|
|
'middleware::auth:ApiRoute',
|
|
|
|
['middleware::api:DataInjection', { access_level: 'update' }],
|
|
|
|
'controller::api:v1:Page.save_node_to_page',
|
|
|
|
],
|
2020-11-11 02:57:43 +00:00
|
|
|
|
|
|
|
// Create a new page in the personal root
|
2020-11-13 03:26:36 +00:00
|
|
|
'/create': [
|
|
|
|
'middleware::auth:ApiRoute',
|
|
|
|
'controller::api:v1:Page.create_top_level',
|
|
|
|
],
|
2020-11-11 02:57:43 +00:00
|
|
|
|
|
|
|
// Create a new page as a child of the specified page
|
2020-11-13 03:26:36 +00:00
|
|
|
'/create-child': [
|
|
|
|
'middleware::auth:ApiRoute',
|
|
|
|
'controller::api:v1:Page.create_child',
|
|
|
|
],
|
2020-11-11 02:57:43 +00:00
|
|
|
|
|
|
|
// Delete the specified page
|
2020-11-13 03:26:36 +00:00
|
|
|
'/delete/:PageId': [
|
|
|
|
'middleware::auth:ApiRoute',
|
|
|
|
['middleware::api:DataInjection', { access_level: 'manage' }],
|
|
|
|
'controller::api:v1:Page.delete_page',
|
|
|
|
],
|
2020-11-11 02:57:43 +00:00
|
|
|
},
|
|
|
|
}
|