mirror of
https://github.com/status-im/embark-area-51.git
synced 2025-01-09 13:36:14 +00:00
add api registration to plugin
This commit is contained in:
parent
ffe4dc8164
commit
9a1ecc68ce
@ -23,6 +23,7 @@ var Plugin = function(options) {
|
||||
this.dappGenerators = [];
|
||||
this.pluginTypes = [];
|
||||
this.uploadCmds = [];
|
||||
this.apiCalls = [];
|
||||
this.imports = [];
|
||||
this.embarkjs_code = [];
|
||||
this.embarkjs_init_code = {};
|
||||
@ -208,6 +209,11 @@ Plugin.prototype.registerActionForEvent = function(eventName, cb) {
|
||||
this.addPluginType('eventActions');
|
||||
};
|
||||
|
||||
Plugin.prototype.registerAPICall = function(method, endpoint, cb) {
|
||||
this.apiCalls.push({method: method, endpoint: endpoint, cb: cb});
|
||||
this.pluginTypes.push('apiCalls');
|
||||
};
|
||||
|
||||
Plugin.prototype.runFilePipeline = function() {
|
||||
var self = this;
|
||||
|
||||
|
@ -46,6 +46,7 @@ Plugins.prototype.createPlugin = function(pluginName, pluginConfig) {
|
||||
interceptLogs: this.interceptLogs,
|
||||
events: this.events,
|
||||
config: this.config,
|
||||
//plugins: this,
|
||||
isInternal: true,
|
||||
context: this.context
|
||||
});
|
||||
@ -66,6 +67,7 @@ Plugins.prototype.loadInternalPlugin = function(pluginName, pluginConfig) {
|
||||
interceptLogs: this.interceptLogs,
|
||||
events: this.events,
|
||||
config: this.config,
|
||||
//plugins: this.plugins,
|
||||
isInternal: true,
|
||||
context: this.context,
|
||||
env: this.env
|
||||
|
Loading…
x
Reference in New Issue
Block a user