2020-10-15 04:13:09 +00:00
|
|
|
/*
|
|
|
|
* API v1 Routes
|
|
|
|
* -------------------------------------------------------------
|
|
|
|
* Description here
|
|
|
|
*/
|
|
|
|
const index = {
|
|
|
|
|
|
|
|
prefix: '/api/v1/exports',
|
|
|
|
|
|
|
|
middleware: [
|
|
|
|
'auth:UserOnly',
|
|
|
|
],
|
|
|
|
|
|
|
|
get: {
|
|
|
|
'/': ['controller::api:v1:Export.get_export_list'],
|
2020-10-18 17:55:32 +00:00
|
|
|
'/:ExportId/download': ['controller::api:v1:Export.download_export'],
|
2020-10-15 04:13:09 +00:00
|
|
|
// '/page/:PageId/info': [
|
|
|
|
// ['middleware::api:RequiredFields', { form: 'sharing.page' }],
|
|
|
|
// ['middleware::api:PageRoute', {level: 'manage'}],
|
|
|
|
// 'controller::api:v1:Sharing.page_info',
|
|
|
|
// ],
|
|
|
|
// '/page/:PageId/link/:level': [
|
|
|
|
// ['middleware::api:RequiredFields', { form: 'sharing.page_link'}],
|
|
|
|
// ['middleware::api:PageRoute', {level: 'manage'}],
|
|
|
|
// 'controller::api:v1:Sharing.get_link',
|
|
|
|
// ],
|
|
|
|
},
|
|
|
|
|
|
|
|
post: {
|
|
|
|
'/subtree': [
|
|
|
|
['middleware::api:RequiredFields', { form: 'exports.subtree' }],
|
|
|
|
['middleware::api:PageRoute', {level: 'view'}],
|
|
|
|
'controller::api:v1:Export.export_subtree',
|
|
|
|
],
|
|
|
|
// // Share a page with the specified user.
|
|
|
|
// '/page/:PageId/share': [
|
|
|
|
// ['middleware::api:RequiredFields', { form: 'sharing.page_level' }],
|
|
|
|
// ['middleware::api:PageRoute', {level: 'manage'}],
|
|
|
|
// 'middleware::api:UserRoute',
|
|
|
|
// 'controller::api:v1:Sharing.share_page',
|
|
|
|
// ],
|
|
|
|
//
|
|
|
|
// // Unshare a page with the specified user.
|
|
|
|
// '/page/:PageId/revoke': [
|
|
|
|
// ['middleware::api:RequiredFields', { form: 'sharing.page_user' }],
|
|
|
|
// ['middleware::api:PageRoute', {level: 'manage'}],
|
|
|
|
// 'middleware::api:UserRoute',
|
|
|
|
// 'controller::api:v1:Sharing.revoke_page',
|
|
|
|
// ],
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = exports = index
|