backend/app/routing/routers/api/v1/file-box.routes.js

72 lines
2.7 KiB
JavaScript
Raw Normal View History

2021-02-04 15:19:04 +00:00
module.exports = exports = {
prefix: '/api/v1/file-box',
middleware: [],
get: {
'/:PageId/:NodeId/:FileBoxId': [
2021-02-04 15:19:04 +00:00
'middleware::auth:ApiRoute',
['middleware::api:DataInjection', { access_level: 'view' }],
'controller::api:v1:FileBox.get_box',
],
'/:PageId/:NodeId/:FileBoxId/history': [
'middleware::auth:ApiRoute',
['middleware::api:DataInjection', { access_level: 'view' }],
'controller::api:v1:FileBox.get_box_history_path',
],
'/:PageId/:NodeId/:FileBoxId/files': [
2021-02-04 15:19:04 +00:00
'middleware::auth:ApiRoute',
['middleware::api:DataInjection', { access_level: 'view' }],
'controller::api:v1:FileBox.get_files',
],
'/:PageId/:NodeId/:FileBoxId/files/:FileBoxFileId': [
'middleware::auth:ApiRoute',
['middleware::api:DataInjection', { access_level: 'view' }],
'controller::api:v1:FileBox.download_file',
],
'/:PageId/:NodeId/:FileBoxId/children': [
'middleware::auth:ApiRoute',
['middleware::api:DataInjection', { access_level: 'view' }],
'controller::api:v1:FileBox.get_children',
],
2021-02-04 15:19:04 +00:00
},
post: {
'/:PageId/:NodeId/create': [
2021-02-04 15:19:04 +00:00
'middleware::auth:ApiRoute',
['middleware::api:DataInjection', { access_level: 'update' }],
'controller::api:v1:FileBox.create',
],
'/:PageId/:NodeId/:FileBoxId': [
2021-02-04 15:19:04 +00:00
'middleware::auth:ApiRoute',
['middleware::api:DataInjection', { access_level: 'update' }],
'controller::api:v1:FileBox.update',
],
'/:PageId/:NodeId/:FileBoxId/files': [
2021-02-04 15:19:04 +00:00
'middleware::auth:ApiRoute',
['middleware::api:DataInjection', { access_level: 'update' }],
['middleware::upload:UploadFile', { tag: 'file_box_file' }],
'controller::api:v1:FileBox.upload_files',
],
'/:PageId/:NodeId/:FileBoxId/files/:FileBoxFileId': [
2021-02-04 15:19:04 +00:00
'middleware::auth:ApiRoute',
['middleware::api:DataInjection', { access_level: 'update' }],
'controller::api:v1:FileBox.update_file',
],
},
delete: {
'/:PageId/:NodeId/:FileBoxId': [
2021-02-04 15:19:04 +00:00
'middleware::auth:ApiRoute',
['middleware::api:DataInjection', { access_level: 'update' }],
'controller::api:v1:FileBox.delete_box',
],
'/:PageId/:NodeId/:FileBoxId/files/:FileBoxFileId': [
2021-02-04 15:19:04 +00:00
'middleware::auth:ApiRoute',
['middleware::api:DataInjection', { access_level: 'update' }],
'controller::api:v1:FileBox.delete_file',
],
},
}