@becomes/cms
Version:
Simple CMS for building APIs.
33 lines (32 loc) • 777 B
TypeScript
import { Request } from 'express';
import { Template } from '../../template';
import { Entry } from '../../entry';
export declare enum EventSource {
ENTRY = "ENTRY",
TEMPLATE = "TEMPLATE"
}
export declare enum EventType {
GET = "GET",
GET_ALL = "GET_ALL",
ADD = "POST",
UPDATE = "PUT",
REMOVE = "DELETE"
}
export interface EventConfig {
source: EventSource;
type: EventType;
entryId?: string;
templateId?: string;
}
export interface EventOutputPipe {
functionName: string;
}
export interface EventOutput {
payload?: any;
pipe?: EventOutputPipe;
}
export interface Event {
name: string;
config: EventConfig;
handler: (request: Request, data: Template | Template[] | Entry | Entry[]) => Promise<EventOutput>;
}