@mediarithmics/plugins-nodejs-sdk
Version:
This is the mediarithmics nodejs to help plugin developers bootstrapping their plugin without having to deal with most of the plugin boilerplate
31 lines (30 loc) • 1.27 kB
TypeScript
import { PluginProperty } from '../../api/core/plugin/PluginPropertyInterface';
import { BasePlugin, PropertiesWrapper } from '../common';
import { CustomAction, CustomActionPluginResponse, CustomActionRequest } from './CustomActionInterface';
export interface CustomActionBaseInstanceContext {
customAction: CustomAction;
properties: PropertiesWrapper;
}
export declare abstract class CustomActionBasePlugin extends BasePlugin<CustomActionBaseInstanceContext> {
constructor(enableThrottling?: boolean);
/**
*
* @param customActionId
*/
fetchCustomAction(customActionId: string): Promise<CustomAction>;
/**
*
* @param customActionId
*/
fetchCustomActionProperties(customActionId: string): Promise<PluginProperty[]>;
protected instanceContextBuilder(customActionId: string): Promise<CustomActionBaseInstanceContext>;
/**
*
* @param request
* @param instanceContext
*/
protected abstract onCustomActionCall(request: CustomActionRequest, instanceContext: CustomActionBaseInstanceContext): Promise<CustomActionPluginResponse>;
protected getInstanceContext(customActionId: string): Promise<CustomActionBaseInstanceContext>;
private emptyBodyFilter;
private initCustomAction;
}