backend/app/routing/routers/api/v1/export.routes.js
garrettmills b5b2a7cd85
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone Build is passing
Rewrite HTML export to support all node types (#3)
2020-10-18 12:55:32 -05:00

54 lines
1.8 KiB
JavaScript

/*
* API v1 Routes
* -------------------------------------------------------------
* Description here
*/
const index = {
prefix: '/api/v1/exports',
middleware: [
'auth:UserOnly',
],
get: {
'/': ['controller::api:v1:Export.get_export_list'],
'/:ExportId/download': ['controller::api:v1:Export.download_export'],
// '/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