new notManifest(app, notApp, moduleName)
Parameters:
Name | Type | Description |
---|---|---|
app |
object | express application instance |
notApp |
object | notApplication instance |
moduleName |
string | name of owner module |
Methods
-
filterManifest(manifest, auth, role, root)
-
Filters manifest for current user auth, role, root. Removes all actions that can not be performed
Parameters:
Name Type Description manifest
object full raw manifest auth
boolean user auth status role
boolean user role status root
boolean user root status Returns:
filtered manifest- Type
- object
-
registerRoute(moduleManifest, routeName)
-
Check if manifest file has url and actions, so we could register routes
Parameters:
Name Type Description moduleManifest
object library of .manifest.js files routeName
string name of -
registerRouteForAction(app, routesPath, routeLine, modelName, actionSetName, actionData)
-
Создаем путь для одной конечной точки
Parameters:
Name Type Description app
object express app object routesPath
string directory where routes files is placed routeLine
string aka '/login', '/user/:id', etc modelName
string name of the mongoose model, should be exact as file name with routes for this model. If /models/theme.js contains 'Theme' mongoose model, then /routes/theme.js should ` contain routes for that model. actionSetName
string name of action in routes file. Look for existing route file for understanding actionData
object representation of action data Returns:
if route were registered- Type
- boolean
-
registerRoutes(moduleManifest)
-
Создаем пути согласно манифесту
Parameters:
Name Type Description moduleManifest
object notManifest of module -
routeHasRoutes(route)
-
Check if manifest file has url, model and actions, so we could register routes
Parameters:
Name Type Description route
object content of .manifest.js file Returns:
true if could create routes- Type
- boolean