UNPKG

@godspeedsystems/plugins-express-as-http

Version:

Godspeed event source plugin for express as http server

27 lines (26 loc) 1.39 kB
import { PlainObject, GSCloudEvent, GSStatus, GSEventSource } from "@godspeedsystems/core"; import express from "express"; import { Request, Response, NextFunction } from "express"; export default class EventSource extends GSEventSource { initClient(): Promise<PlainObject>; setupMiddleware(app: express.Express): void; setupAuthentication(app: express.Express): void; setupJwtAuthentication(app: express.Express, jwtConfig: PlainObject): void; setupGoogleAuthentication(app: express.Express, googleConfig: PlainObject): void; setupLinkedInAuthentication(app: express.Express, linkedinConfig: PlainObject): void; setupGithubAuthentication(app: express.Express, githubConfig: PlainObject): void; setupMetrics(app: express.Express): void; protected authnHOF(authn: boolean): (req: Request, res: Response, next: NextFunction) => any; subscribeToEvent(eventRoute: string, eventConfig: PlainObject, processEvent: (event: GSCloudEvent, eventConfig: PlainObject) => Promise<GSStatus>, event?: PlainObject): Promise<void>; protected parseJsonIfPossible(value: any): any; } declare const SourceType = "ES"; declare const Type = "express"; declare const CONFIG_FILE_NAME = "http"; declare const DEFAULT_CONFIG: { port: number; docs: { endpoint: string; }; }; export { EventSource, SourceType, Type, CONFIG_FILE_NAME, DEFAULT_CONFIG };