module.exports = exports = {

    prefix: '/api/v1/file-box',

    middleware: [],

    get: {
        '/:PageId/:NodeId/:FileBoxId': [
            'middleware::auth:ApiRoute',
            ['middleware::api:DataInjection', { access_level: 'view' }],
            'controller::api:v1:FileBox.get_box',
        ],
        '/:PageId/:NodeId/:FileBoxId/files': [
            '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',
        ],
    },

    post: {
        '/:PageId/:NodeId/create': [
            'middleware::auth:ApiRoute',
            ['middleware::api:DataInjection', { access_level: 'update' }],
            'controller::api:v1:FileBox.create',
        ],
        '/:PageId/:NodeId/:FileBoxId': [
            'middleware::auth:ApiRoute',
            ['middleware::api:DataInjection', { access_level: 'update' }],
            'controller::api:v1:FileBox.update',
        ],
        '/:PageId/:NodeId/:FileBoxId/files': [
            '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': [
            'middleware::auth:ApiRoute',
            ['middleware::api:DataInjection', { access_level: 'update' }],
            'controller::api:v1:FileBox.update_file',
        ],
    },

    delete: {
        '/:PageId/:NodeId/:FileBoxId': [
            'middleware::auth:ApiRoute',
            ['middleware::api:DataInjection', { access_level: 'update' }],
            'controller::api:v1:FileBox.delete_box',
        ],
        '/:PageId/:NodeId/:FileBoxId/files/:FileBoxFileId': [
            'middleware::auth:ApiRoute',
            ['middleware::api:DataInjection', { access_level: 'update' }],
            'controller::api:v1:FileBox.delete_file',
        ],
    },
}
