2020-11-11 02:57:43 +00:00
|
|
|
module.exports = exports = {
|
|
|
|
|
|
|
|
prefix: '/api/v1/files',
|
|
|
|
|
2020-11-11 18:23:31 +00:00
|
|
|
middleware: [],
|
2020-11-11 02:57:43 +00:00
|
|
|
|
|
|
|
get: {
|
|
|
|
// Get the file ref node config for the specified file ref
|
2020-11-11 19:54:20 +00:00
|
|
|
'/:PageId/:NodeId/get/:FilesId': [
|
|
|
|
'middleware::auth:ApiRoute',
|
|
|
|
['middleware::api:DataInjection', { access_level: 'view' }],
|
|
|
|
'controller::api:v1:File.get_config',
|
|
|
|
],
|
2020-11-11 02:57:43 +00:00
|
|
|
|
|
|
|
// Download the specified file ID from the specified file ref node
|
2020-11-11 19:54:20 +00:00
|
|
|
'/:PageId/:NodeId/get/:FilesId/:FileId': [
|
|
|
|
'middleware::auth:ApiRoute',
|
|
|
|
['middleware::api:DataInjection', { access_level: 'view' }],
|
|
|
|
'controller::api:v1:File.download',
|
|
|
|
],
|
2020-11-11 02:57:43 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
post: {
|
|
|
|
// Upload the file in the 'uploaded_file' key to the specified file ref node
|
2020-11-15 16:59:03 +00:00
|
|
|
'/upload/:PageId/:NodeId/:FilesId': [
|
2020-11-11 19:54:20 +00:00
|
|
|
'middleware::auth:ApiRoute',
|
|
|
|
['middleware::api:DataInjection', { access_level: 'update' }],
|
|
|
|
'middleware::upload:UploadFile',
|
|
|
|
'controller::api:v1:File.save_upload',
|
|
|
|
],
|
2020-11-11 02:57:43 +00:00
|
|
|
|
|
|
|
// Create a new file ref node
|
2020-11-11 19:54:20 +00:00
|
|
|
'/:PageId/:NodeId/create': [
|
|
|
|
'middleware::auth:ApiRoute',
|
|
|
|
['middleware::api:DataInjection', { access_level: 'update' }],
|
|
|
|
'controller::api:v1:File.create_config',
|
|
|
|
],
|
2020-11-11 02:57:43 +00:00
|
|
|
|
|
|
|
// Delete a file ref node and its files
|
2020-11-11 19:54:20 +00:00
|
|
|
'/:PageId/:NodeId/delete/:FilesId': [
|
|
|
|
'middleware::auth:ApiRoute',
|
|
|
|
['middleware::api:DataInjection', { access_level: 'update' }],
|
|
|
|
'controller::api:v1:File.delete_group',
|
|
|
|
],
|
2020-11-11 02:57:43 +00:00
|
|
|
},
|
|
|
|
}
|