CorePluginApi
Summary
Defines the Core Plugin API exposed to other plugins.
Constructor
CorePluginApi
Syntax
CorePluginApi
()
Summary
Item Index
Methods
Methods
clearImageCache
Syntax
clearImageCache
(
-
string
-
string
-
callback
Summary
Clear image cache
getAnonymousUserId
Syntax
Summary
Gets the id of the anonymous user.
Returns:
String:
The anonymous user id
getDatabase
Syntax
getDatabase
()
Database
Summary
Gets the current database instance.
Returns:
Database:
The application's database
getEntities
Syntax
Summary
Gets the list of entities defined by plugins.
Returns:
Object:
The list of entities by entity name
getPermissions
Syntax
Summary
Gets the list of permissions defined by plugins.
Returns:
Object:
The list of permissions
getServerConfiguration
Syntax
Summary
Gets information about the application server.
Returns:
Object:
The server configuration
getSuperAdminId
Syntax
Summary
Gets the id of the super administrator.
Returns:
String:
The super administrator id
getTranslations
Syntax
getTranslations
(
async
-
dictionary
-
code
-
callback
Summary
Gets a dictionary of translations by its name and language.
Search is made on i18n directory and all plugin's i18n directories. If the same dictionary name is found twice (same file name in different i18n directories), dictionaries are merged.
Parameters:
Example:
process.api.getCoreApi().getTranslations('login', 'fr-FR', function(error, translations) {
console.log(translations);
});
process.api.getCoreApi().getTranslations('back-office', 'en', function(error, translations) {
console.log(translations);
});