UNPKG

@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

13 lines (12 loc) 834 B
import express from 'express'; import winston from 'winston'; import { BatchUpdateContext, BatchUpdatePluginResponse, BatchUpdateRequest } from './BatchUpdateInterface'; export type CallOnBatchUpdate<C extends BatchUpdateContext, T> = (request: BatchUpdateRequest<C, T>) => Promise<BatchUpdatePluginResponse>; export type DeserializerT<T> = (obj: string) => T; export declare class BatchUpdateHandler<C extends BatchUpdateContext, T> { logger: winston.Logger; app: express.Application; emptyBodyFilter: (req: express.Request, res: express.Response, next: express.NextFunction) => void; constructor(app: express.Application, emptyBodyFilter: (req: express.Request, res: express.Response, next: express.NextFunction) => void, logger: winston.Logger); registerRoute(onbatchUpdateFn: CallOnBatchUpdate<C, T>): void; }