PluginApi
Summary
Defines a base plugin API for all plugins' which need to expose an API.
// Implement a PluginApi : "MyPluginApi"
// for a plugin named "my-plugin"
var util = require('util');
var openVeoApi = require('@openveo/api');
function MyPluginApi() {
MyPluginApi.super_.call(this);
}
util.inherits(MyPluginApi, openVeoApi.plugin.PluginApi);
// Associate the API to the plugin when creating it
function MyPlugin() {
MyPlugin.super_.call(this);
// Exposes MyPlugin's APIs
this.api = new MyPluginApi();
}
util.inherits(MyPlugin, openVeoApi.plugin.Plugin);
Constructor
PluginApi
Syntax
PluginApi
()
Summary
Methods
executeHook
Syntax
executeHook
(
async
-
hook
-
data
-
callback
Summary
Executes all actions registered for a hook.
All actions are executed in the registration order.
getHooks
Syntax
Summary
Gets available hooks of the plugin.
This should be overrided by plugins.
Returns:
Object:
The list of hooks
registerAction
Syntax
registerAction
(
async
-
hook
-
action
Summary
Registers an action to be executed when a hook occurs.
Properties
actions
Syntax
Summary
The list of registered actions.
Property names are the action names and values are functions.