2020-11-11 02:57:43 +00:00
|
|
|
module.exports = exports = {
|
|
|
|
|
|
|
|
prefix: '/api/v1/db',
|
|
|
|
|
2020-11-11 18:23:31 +00:00
|
|
|
middleware: [],
|
2020-11-11 02:57:43 +00:00
|
|
|
|
|
|
|
get: {
|
|
|
|
// Get the database ref node config for the specified database
|
2020-11-11 19:54:20 +00:00
|
|
|
'/:PageId/:NodeId/get/:DatabaseId': [
|
|
|
|
'middleware::auth:ApiRoute',
|
|
|
|
['middleware::api:DataInjection', { access_level: 'view' }],
|
|
|
|
'controller::api:v1:FormDatabase.get_config',
|
|
|
|
],
|
2020-11-11 02:57:43 +00:00
|
|
|
|
|
|
|
// Get the column config records for the specified database
|
2020-11-11 19:54:20 +00:00
|
|
|
'/:PageId/:NodeId/get/:DatabaseId/columns': [
|
|
|
|
'middleware::auth:ApiRoute',
|
|
|
|
['middleware::api:DataInjection', { access_level: 'view' }],
|
|
|
|
'controller::api:v1:FormDatabase.get_columns',
|
|
|
|
],
|
2020-11-11 02:57:43 +00:00
|
|
|
|
|
|
|
// Get the row records for the specified database
|
2020-11-11 19:54:20 +00:00
|
|
|
'/:PageId/:NodeId/get/:DatabaseId/data': [
|
|
|
|
'middleware::auth:ApiRoute',
|
|
|
|
['middleware::api:DataInjection', { access_level: 'view' }],
|
|
|
|
'controller::api:v1:FormDatabase.get_data',
|
|
|
|
],
|
2020-11-11 02:57:43 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
post: {
|
|
|
|
// Create a new database ref config
|
2020-11-11 19:54:20 +00:00
|
|
|
'/:PageId/:NodeId/create': [
|
|
|
|
'middleware::auth:ApiRoute',
|
|
|
|
['middleware::api:DataInjection', { access_level: 'update' }],
|
|
|
|
'controller::api:v1:FormDatabase.create_new',
|
|
|
|
],
|
2020-11-11 02:57:43 +00:00
|
|
|
|
|
|
|
// Set the column configs for a database ref
|
2020-11-11 19:54:20 +00:00
|
|
|
'/:PageId/:NodeId/set/:DatabaseId/columns': [
|
|
|
|
'middleware::auth:ApiRoute',
|
|
|
|
['middleware::api:DataInjection', { access_level: 'update' }],
|
|
|
|
'controller::api:v1:FormDatabase.set_columns',
|
|
|
|
],
|
2020-11-11 02:57:43 +00:00
|
|
|
|
|
|
|
// Set the database name
|
2020-11-11 19:54:20 +00:00
|
|
|
'/:PageId/:NodeId/set/:DatabaseId/Name': [
|
|
|
|
'middleware::auth:ApiRoute',
|
|
|
|
['middleware::api:DataInjection', { access_level: 'update' }],
|
|
|
|
'controller::api:v1:FormDatabase.set_name',
|
|
|
|
],
|
2020-11-11 02:57:43 +00:00
|
|
|
|
|
|
|
// Delete the specified database ref
|
2020-11-11 19:54:20 +00:00
|
|
|
'/:PageId/:NodeId/drop/:DatabaseId': [
|
|
|
|
'middleware::auth:ApiRoute',
|
|
|
|
['middleware::api:DataInjection', { access_level: 'update' }],
|
|
|
|
'controller::api:v1:FormDatabase.drop_database',
|
|
|
|
],
|
2020-11-11 02:57:43 +00:00
|
|
|
|
|
|
|
// Set the row data for the specified database ref
|
2020-11-11 19:54:20 +00:00
|
|
|
'/:PageId/:NodeId/set/:DatabaseId/data': [
|
|
|
|
'middleware::auth:ApiRoute',
|
|
|
|
['middleware::api:DataInjection', { access_level: 'update' }],
|
|
|
|
'controller::api:v1:FormDatabase.set_data',
|
|
|
|
],
|
2020-11-11 02:57:43 +00:00
|
|
|
},
|
|
|
|
}
|