Comparing version 1.0.2 to 1.0.3
module.exports = [ | ||
{ | ||
path:'settings', | ||
controller:{}, | ||
path:'users', | ||
controller:<controller object goes here>, | ||
middleware:[ | ||
require('../controllers/settingspermissions') | ||
<middleware objects go here> | ||
], | ||
data:{ | ||
id:'settingID', | ||
model:'Settings', | ||
id:'userID', | ||
model:'Users', | ||
required:[ | ||
'name' | ||
'name', | ||
'email', | ||
'password' | ||
], | ||
optional:[ | ||
'description', | ||
'ownerID', | ||
'public', | ||
'unrestricted' | ||
'phone', | ||
'address' | ||
], | ||
public:[ | ||
'id', | ||
'name', | ||
'description', | ||
'ownerID', | ||
'public', | ||
'unrestricted' | ||
'email', | ||
'phone', | ||
'address' | ||
], | ||
req:[ | ||
{ | ||
name:'ownerID', | ||
name:'organizationID', | ||
hierarchy:[ | ||
'user', | ||
'org', | ||
'id' | ||
@@ -40,215 +40,24 @@ ] | ||
{ | ||
path:'people', | ||
path:'posts', | ||
controller:<controller object goes here>, | ||
middleware:[ | ||
<middleware objects go here> | ||
], | ||
data:{ | ||
id:'personID', | ||
belongsTo:'settingID', | ||
model:'People', | ||
id:'postID', | ||
belongsTo:'userID', | ||
model:'Posts', | ||
required:[ | ||
'name' | ||
'content' | ||
], | ||
optional:[ | ||
'profession', | ||
'appearance', | ||
'personality', | ||
'history' | ||
], | ||
optional:[], | ||
public:[ | ||
'id', | ||
'name', | ||
'appearance', | ||
'personality', | ||
'history' | ||
'content', | ||
'userID' | ||
] | ||
} | ||
}, | ||
{ | ||
path:'locations', | ||
data:{ | ||
id:'locationID', | ||
belongsTo:'settingID', | ||
model:'Locations', | ||
required:[ | ||
'name' | ||
], | ||
optional:[ | ||
'type', | ||
'description', | ||
'history', | ||
'population', | ||
'populationDensity', | ||
'crime', | ||
'wealth' | ||
], | ||
public:[ | ||
'id', | ||
'name', | ||
'type', | ||
'description', | ||
'history', | ||
'population', | ||
'populationDensity', | ||
'crime', | ||
'wealth' | ||
] | ||
} | ||
}, | ||
{ | ||
path:'civilizations', | ||
data:{ | ||
id:'civilizationID', | ||
belongsTo:'settingID', | ||
model:'Civilizations', | ||
required:[ | ||
'name' | ||
], | ||
optional:[ | ||
'description' | ||
], | ||
public:[ | ||
'id', | ||
'name', | ||
'description', | ||
'settingID' | ||
] | ||
} | ||
}, | ||
{ | ||
path:'items', | ||
data:{ | ||
id:'itemID', | ||
belongsTo:'settingID', | ||
model:'Items', | ||
required:[ | ||
'name' | ||
], | ||
optional:[ | ||
'type', | ||
'appearance', | ||
'history' | ||
], | ||
public:[ | ||
'id', | ||
'name', | ||
'type', | ||
'appearance', | ||
'history' | ||
] | ||
} | ||
}, | ||
{ | ||
path:'events', | ||
data:{ | ||
id:'eventID', | ||
belongsTo:'settingID', | ||
model:'Events', | ||
required:[ | ||
'name' | ||
], | ||
optional:[ | ||
'type', | ||
'year', | ||
'description' | ||
], | ||
public:[ | ||
'id', | ||
'name', | ||
'type', | ||
'year', | ||
'description' | ||
] | ||
} | ||
}, | ||
{ | ||
path:'races', | ||
data:{ | ||
id:'raceID', | ||
belongsTo:'settingID', | ||
model:'Races', | ||
required:[ | ||
'name' | ||
], | ||
optional:[ | ||
'description', | ||
'appearance' | ||
], | ||
public:[ | ||
'id', | ||
'name', | ||
'description', | ||
'appearance' | ||
] | ||
} | ||
}, | ||
{ | ||
path:'creatures', | ||
data:{ | ||
id:'creatureID', | ||
belongsTo:'settingID', | ||
model:'Creatures', | ||
required:[ | ||
'name' | ||
], | ||
optional:[ | ||
'description', | ||
'history' | ||
], | ||
public:[ | ||
'id', | ||
'name', | ||
'description', | ||
'history' | ||
] | ||
} | ||
}, | ||
{ | ||
path:'species', | ||
data:{ | ||
id:'speciesID', | ||
belongsTo:'settingID', | ||
model:'Species', | ||
required:[ | ||
'name' | ||
], | ||
optional:[ | ||
'description', | ||
'appearance' | ||
], | ||
public:[ | ||
'id', | ||
'name', | ||
'description', | ||
'appearance' | ||
] | ||
} | ||
}, | ||
{ | ||
path:'spirits', | ||
data:{ | ||
id:'spiritID', | ||
belongsTo:'settingID', | ||
model:'Spirits', | ||
required:[ | ||
'name' | ||
], | ||
optional:[ | ||
'type', | ||
'description', | ||
'history', | ||
'unique' | ||
], | ||
public:[ | ||
'id', | ||
'name', | ||
'description', | ||
'history', | ||
'unique' | ||
] | ||
} | ||
} | ||
] | ||
}, | ||
{ | ||
path:'users', | ||
id:'userID' | ||
} | ||
]; |
{ | ||
"name": "routesmith", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "A simple, lightweight routing solution for Express.", | ||
@@ -5,0 +5,0 @@ "main": "autorouter.js", |
@@ -58,3 +58,5 @@ #RouteSmith | ||
controller:<controller object goes here>, | ||
middleware:[], | ||
middleware:[ | ||
<middleware objects go here> | ||
], | ||
data:{ | ||
@@ -93,2 +95,6 @@ id:'userID', | ||
path:'posts', | ||
controller:<controller object goes here>, | ||
middleware:[ | ||
<middleware objects go here> | ||
], | ||
data:{ | ||
@@ -112,2 +118,9 @@ id:'postID', | ||
] | ||
``` | ||
Based on this structure, we would have the following routes: | ||
```bash | ||
/users | ||
/users/:userID | ||
/users/:userID/posts | ||
/users/:userID/posts/:postID | ||
``` |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
123
7337
100
1