@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
18 lines (17 loc) • 1.15 kB
TypeScript
import { PluginProperty } from '../../api/core/plugin/PluginPropertyInterface';
import { Catalog, RecommendationsWrapper } from '../../api/datamart';
import { RecommenderRequest } from '../../api/plugin/recommender/RecommenderRequestInterface';
import { BasePlugin, PropertiesWrapper } from '../common/BasePlugin';
export interface RecommenderBaseInstanceContext {
properties: PropertiesWrapper;
}
export declare abstract class RecommenderPlugin extends BasePlugin<RecommenderBaseInstanceContext> {
instanceContext: Promise<RecommenderBaseInstanceContext>;
constructor();
fetchRecommenderCatalogs(recommenderId: string): Promise<Catalog[]>;
fetchRecommenderProperties(recommenderId: string): Promise<PluginProperty[]>;
protected instanceContextBuilder(recommenderId: string): Promise<RecommenderBaseInstanceContext>;
protected getInstanceContext(recommenderId: string): Promise<RecommenderBaseInstanceContext | null>;
protected abstract onRecommendationRequest(request: RecommenderRequest, instanceContext: RecommenderBaseInstanceContext | null): Promise<RecommendationsWrapper>;
private initRecommendationRequest;
}